Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

include/om/omdatabase.h File Reference

API for working with Xapian databases. More...

#include "om/omdocument.h"
#include "om/ompostlistiterator.h"
#include "om/omtermlistiterator.h"
#include "om/ompositionlistiterator.h"

Go to the source code of this file.

Compounds

class  OmDatabase
 This class is used to access a database, or a set of databases. More...

class  OmWritableDatabase
 This class provides read/write access to a database. More...


Functions

OmDatabase OmAuto__open (const std::string &path)
 Open a database read-only, automatically determining the database backend to use. More...

OmWritableDatabase OmAuto__open (const std::string &path, int action)
 Open a database for update, automatically determining the database backend to use. More...

OmDatabase OmQuartz__open (const std::string &dir)
 Open a Quartz database read-only. More...

OmWritableDatabase OmQuartz__open (const std::string &dir, int action, int block_size=8192)
 Open a Quartz database for update. More...

OmWritableDatabase OmInMemory__open ()
 Open an InMemory database for update. More...

OmDatabase OmMuscat36DA__open (const std::string &R, const std::string &T, bool heavy_duty=true)
 Open a Muscat 3.6 DA database. More...

OmDatabase OmMuscat36DA__open (const std::string &R, const std::string &T, const std::string &values, bool heavy_duty=true)
 Open a Muscat 3.6 DA database. More...

OmDatabase OmMuscat36DB__open (const std::string &DB, size_t cache_size=30)
 Open a Muscat 3.6 DB database. More...

OmDatabase OmMuscat36DB__open (const std::string &DB, const std::string &values="", size_t cache_size=30)
 Open a Muscat 3.6 DB database. More...

OmDatabase OmRemote__open (const std::string &program, const std::string &args, unsigned int timeout=10000)
 Open a remote database (using a program). More...

OmDatabase OmRemote__open (const std::string &host, unsigned int port, unsigned int timeout=10000, unsigned int connect_timeout=0)
 Open a remote database (using a TCP connection). More...

OmDatabase OmStub__open (const std::string &file)
 Open a stub database. More...


Variables

const int OM_DB_CREATE_OR_OPEN = 1
const int OM_DB_CREATE = 2
const int OM_DB_CREATE_OR_OVERWRITE = 3
const int OM_DB_OPEN = 4


Detailed Description

API for working with Xapian databases.


Function Documentation

OmWritableDatabase OmAuto__open const std::string &    path,
int    action
 

Open a database for update, automatically determining the database backend to use.

Parameters:
path  directory that the database is stored in.
action  one of:
  • OM_DB_CREATE_OR_OPEN open for read/write; create if no db exists
  • OM_DB_CREATE create new database; fail if db exists
  • OM_DB_CREATE_OR_OVERWRITE overwrite existing db; create if none exists
  • OM_DB_OPEN open for read/write; fail if no db exists

OmDatabase OmAuto__open const std::string &    path
 

Open a database read-only, automatically determining the database backend to use.

Parameters:
path  directory that the database is stored in.

OmWritableDatabase OmInMemory__open  
 

Open an InMemory database for update.

OmDatabase OmMuscat36DA__open const std::string &    R,
const std::string &    T,
const std::string &    values,
bool    heavy_duty = true
 

Open a Muscat 3.6 DA database.

This opens a DA database with a values file.

Parameters:
R  filename of the Record file
T  filename of the Term file
values  filename of the values file
heavy_duty  is this database heavy-duty (3 byte lengths) or flimsy (2 byte lengths)

OmDatabase OmMuscat36DA__open const std::string &    R,
const std::string &    T,
bool    heavy_duty = true
 

Open a Muscat 3.6 DA database.

This opens a DA database with no values file.

Parameters:
R  filename of the Record file
T  filename of the Term file
heavy_duty  is this database heavy-duty (3 byte lengths) or flimsy (2 byte lengths)

OmDatabase OmMuscat36DB__open const std::string &    DB,
const std::string &    values = "",
size_t    cache_size = 30
 

Open a Muscat 3.6 DB database.

This opens a DB database with a values file. The backend auto-detects if the database is heavy-duty or flimsy.

Parameters:
DB  filename of the database btree file
values  filename of the values file
cache_size  how many blocks to cache (default 30).

OmDatabase OmMuscat36DB__open const std::string &    DB,
size_t    cache_size = 30
 

Open a Muscat 3.6 DB database.

This opens a DB database with no values file. The backend auto-detects if the database is heavy-duty or flimsy.

Parameters:
DB  filename of the database btree file
cache_size  how many blocks to cache

OmWritableDatabase OmQuartz__open const std::string &    dir,
int    action,
int    block_size = 8192
 

Open a Quartz database for update.

Parameters:
dir  directory that the database is stored in.
action  one of:
  • OM_DB_CREATE_OR_OPEN open for read/write; create if no db exists
  • OM_DB_CREATE create new database; fail if db exists
  • OM_DB_CREATE_OR_OVERWRITE overwrite existing db; create if none exists
  • OM_DB_OPEN open for read/write; fail if no db exists
Parameters:
block_size  the size of the blocks to use in the tables, in bytes. Acceptable values are powers of two in the range 2048 to 65536. The default is 8192. This setting is only used when creating databases. If the database already exists, it is completely ignored.

OmDatabase OmQuartz__open const std::string &    dir
 

Open a Quartz database read-only.

Parameters:
dir  directory that the database is stored in.

OmDatabase OmRemote__open const std::string &    host,
unsigned int    port,
unsigned int    timeout = 10000,
unsigned int    connect_timeout = 0
 

Open a remote database (using a TCP connection).

This opens a remote database by connecting to the specified TCP port on the specified host.

Parameters:
host  the name of the host running a tcp server
port  the port on which the tcp server is running
timeout  how long to wait for a response (in milliseconds). If this timeout is reached for any operation, then an OmNetworkTimeout exception will be thrown. The default if not specified is 10000ms (10 seconds).
connect_timeout  how long to wait when attempting to connect to the server. If this timeout is reached when attempting to connect, then an OmNetworkTimeout exception wil be thrown. The default if not specified is to use the same value given for timeout.

OmDatabase OmRemote__open const std::string &    program,
const std::string &    args,
unsigned int    timeout = 10000
 

Open a remote database (using a program).

This opens a remote database by running a program which it communicates with on stdin/stdout.

Parameters:
program  the program to run
arguments  the arguments to pass to the program
timeout  how long to wait for a response (in milliseconds). If this timeout is reached for any operation, then an OmNetworkTimeout exception will be thrown. The default if not specified is 10000ms (10 seconds).

OmDatabase OmStub__open const std::string &    file
 

Open a stub database.

This opens a file which contains types and serialised parameters for one or more databases.

Parameters:
file  the stub database file


Documentation for Xapian (version 0.6.3).
Generated on 14 Dec 2002 by Doxygen 1.2.15.