# Xapian::Auto Namespace Reference

Database factory functions which determine the database type automatically. More...

## Functions

Database | open_stub (const std::string &file)
| Construct a Database object for a stub database file.
WritableDatabase | open_stub (const std::string &file, int action)
| Construct a WritableDatabase object for a stub database file.

## Detailed Description

Database factory functions which determine the database type automatically.

## Function Documentation

WritableDatabase Xapian::Auto::open_stub | ( | const std::string & | file,
|  | int | action |
| ) |  |  |

Construct a WritableDatabase object for a stub database file.

The stub database file must contain serialised parameters for exactly one database.

Parameters:

  | file | pathname of the stub database file.

  action

  determines handling of existing/non-existing database:
  - Xapian::DB_CREATE fail if database already exist, otherwise create new database.
  - Xapian::DB_CREATE_OR_OPEN open existing database, or create new database if none exists.
  - Xapian::DB_CREATE_OR_OVERWRITE overwrite existing database, or create new database if none exists.
  - Xapian::DB_OPEN open existing database, failing if none exists.

Database Xapian::Auto::open_stub | ( | const std::string & | file | ) |

Construct a Database object for a stub database file.

The stub database file contains serialised parameters for one or more databases.

Parameters:

  | file | pathname of the stub database file.