42 #ifdef XAPIAN_HAS_GLASS_BACKEND 45 #ifdef XAPIAN_HAS_CHERT_BACKEND 48 #ifdef XAPIAN_HAS_INMEMORY_BACKEND 65 [&db](
const string& path) {
68 [&db](
const string& path) {
69 #ifdef XAPIAN_HAS_CHERT_BACKEND 75 [&db](
const string& path) {
76 #ifdef XAPIAN_HAS_GLASS_BACKEND 82 [&db](
const string& prog,
const string& args) {
83 #ifdef XAPIAN_HAS_REMOTE_BACKEND 90 [&db](
const string& host,
unsigned port) {
91 #ifdef XAPIAN_HAS_REMOTE_BACKEND 99 #ifdef XAPIAN_HAS_INMEMORY_BACKEND 117 [&db, flags](
const string& path) {
120 [&db, &flags](
const string& path) {
124 [&db, &flags](
const string& path) {
128 [&db, flags](
const string& prog,
const string& args) {
129 #ifdef XAPIAN_HAS_REMOTE_BACKEND 137 [&db, flags](
const string& host,
unsigned port) {
138 #ifdef XAPIAN_HAS_REMOTE_BACKEND 151 if (db.internal.empty()) {
156 Database::Database(
const string &path,
int flags)
160 int type = flags & DB_BACKEND_MASK_;
163 #ifdef XAPIAN_HAS_CHERT_BACKEND 170 #ifdef XAPIAN_HAS_GLASS_BACKEND 180 #ifdef XAPIAN_HAS_INMEMORY_BACKEND 189 if (stat(path.c_str(), &statbuf) == -1) {
190 if (errno == ENOENT) {
197 if (
S_ISREG(statbuf.st_mode)) {
204 #ifdef XAPIAN_HAS_GLASS_BACKEND 221 #ifdef XAPIAN_HAS_CHERT_BACKEND 228 #ifdef XAPIAN_HAS_GLASS_BACKEND 236 string stub_file = path;
237 stub_file +=
"/XAPIANDB";
243 #ifndef XAPIAN_HAS_CHERT_BACKEND 248 #ifndef XAPIAN_HAS_GLASS_BACKEND 260 Database::Database(
int fd,
int flags)
266 #ifdef XAPIAN_HAS_GLASS_BACKEND 267 int type = flags & DB_BACKEND_MASK_;
281 #if defined XAPIAN_HAS_CHERT_BACKEND || \ 282 defined XAPIAN_HAS_GLASS_BACKEND 283 #define HAVE_DISK_BACKEND 286 WritableDatabase::WritableDatabase(
const std::string &path,
int flags,
int block_size)
289 LOGCALL_CTOR(API,
"WritableDatabase", path|flags|block_size);
292 int type = flags & DB_BACKEND_MASK_;
294 flags &= ~DB_BACKEND_MASK_;
297 if (stat(path.c_str(), &statbuf) == -1) {
304 if (
S_ISREG(statbuf.st_mode)) {
316 #ifdef XAPIAN_HAS_CHERT_BACKEND 323 #ifdef XAPIAN_HAS_GLASS_BACKEND 333 string stub_file = path;
334 stub_file +=
"/XAPIANDB";
350 #ifdef XAPIAN_HAS_GLASS_BACKEND 355 #ifdef XAPIAN_HAS_CHERT_BACKEND 361 #ifdef XAPIAN_HAS_INMEMORY_BACKEND 368 #ifndef HAVE_DISK_BACKEND const int DB_BACKEND_INMEMORY
Use the "in memory" backend.
The Xapian namespace contains public interfaces for the Xapian library.
A database held entirely in memory.
This class is used to access a database, or a group of databases.
DatabaseOpeningError indicates failure to open a database.
A writable chert database.
Provides wrappers with POSIXy semantics.
Constants in the Xapian namespace.
Helper functions for database handling.
WritableDatabase open()
Construct a WritableDatabase object for a new, empty InMemory database.
static void open_stub(WritableDatabase &db, const string &file, int flags)
Convert types to std::string.
Utility functions for testing files.
const int DB_BACKEND_GLASS
Use the glass backend.
A writable glass database.
int test_if_single_file_db(const struct stat &sb, const string &path, int *fd_ptr)
Probe if a path is a single-file database.
Hierarchy of classes which Xapian can throw as exceptions.
InvalidArgumentError indicates an invalid parameter value was passed to the API.
This class provides read/write access to a database.
Indicates an attempt to use a feature which is unavailable.
API for working with Xapian databases.
C++ class definition for glass database.
C++ class definition for inmemory database access.
Indicates an attempt to access a database not present.
void read_stub_file(const std::string &file, A1 action_auto, A2 action_chert, A3 action_glass, A4 action_remote_prog, A5 action_remote_tcp, A6 action_inmemory)
Open, read and process a stub database file.
#define LOGCALL_CTOR(CATEGORY, CLASS, PARAMS)
A backend designed for efficient indexing and retrieval, using compressed posting lists and a btree s...
void add_database(const Database &database)
Add an existing database (or group of databases) to those accessed by this object.
C++ class definition for chert database.
Define preprocessor symbols for the library version.
const int DB_BACKEND_STUB
Open a stub database file.
static void open_stub(Database &db, const string &file)
void add_database(const WritableDatabase &other)
Add shards from another WritableDatabase.
A backend designed for efficient indexing and retrieval, using compressed posting lists and a btree s...
WritableDatabase open_writable(const std::string &host, unsigned int port, useconds_t timeout=0, useconds_t connect_timeout=10000, int flags=0)
Construct a WritableDatabase object for update access to a remote database accessed via a TCP connect...
Factory functions for constructing Database and WritableDatabase objects.
bool file_exists(const char *path)
Test if a file exists.
File and path manipulation routines.
const int DB_BACKEND_CHERT
Use the chert backend.