File: backendmanager_quartz.cc

package info (click to toggle)
xapian-core 1.0.7-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 13,940 kB
  • ctags: 13,203
  • sloc: cpp: 69,340; sh: 9,355; ansic: 7,251; perl: 782; makefile: 471
file content (69 lines) | stat: -rw-r--r-- 1,976 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/** @file backendmanager_quartz.cc
 * @brief BackendManager subclass for quartz databases.
 */
/* Copyright (C) 2007 Olly Betts
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 */

#include <config.h>

// We have to use the deprecated Quartz::open() method.
#define XAPIAN_DEPRECATED(D) D
#include <xapian.h>

#include "backendmanager_quartz.h"

using namespace std;

BackendManagerQuartz::~BackendManagerQuartz() { }

const char *
BackendManagerQuartz::get_dbtype() const
{
    return "quartz";
}

Xapian::Database
BackendManagerQuartz::get_database(const vector<string> & files)
{
    return Xapian::Quartz::open(createdb_quartz(files));
}

Xapian::Database
BackendManagerQuartz::get_database(const string & file)
{
    return Xapian::Quartz::open(createdb_quartz(vector<string>(1, file)));
}

Xapian::WritableDatabase
BackendManagerQuartz::get_writable_database(const string & name,
					    const string & file)
{
    last_wdb_name = name;
    return getwritedb_quartz(name, vector<string>(1, file));
}

Xapian::Database
BackendManagerQuartz::get_writable_database_as_database()
{
    return Xapian::Quartz::open(".quartz/" + last_wdb_name);
}

Xapian::WritableDatabase
BackendManagerQuartz::get_writable_database_again()
{
    return Xapian::Quartz::open(".quartz/" + last_wdb_name, Xapian::DB_OPEN);
}