37 sub_manager(sub_manager_),
38 cachedir(
".singlefile" + sub_manager_->
get_dbtype())
48 for (
const string& file : files) {
56 string tmp_path = db_path +
".tmp";
59 if (rename(tmp_path.c_str(), db_path.c_str()) < 0) {
86 string tmpfile = path +
".tmp";
96 if (rename(tmpfile.c_str(), path.c_str()) < 0) {
void finalise_generated_database(const std::string &name)
Finalise generated database.
This class is used to access a database, or a group of databases.
Xapian::Database get_database(const std::vector< std::string > &files)
Get a database instance of the current type.
virtual std::string get_generated_database_path(const std::string &name)
Get the path to use for generating a database, if supported.
Xapian::WritableDatabase get_generated_database(const std::string &name)
Get generated database.
virtual Xapian::WritableDatabase get_generated_database(const std::string &name)
Get a generated writable database instance.
C++ function versions of useful Unix commands.
Utility functions for testing files.
const int DBCOMPACT_NO_RENUMBER
Use the same document ids in the output as in the input(s).
bool create_dir_if_needed(const std::string &dirname)
Create the directory dirname if needed.
BackendManagerSingleFile(const BackendManagerSingleFile &)
Don't allow copying.
BackendManager * sub_manager
This class provides read/write access to a database.
std::string get_generated_database_path(const std::string &name)
Get the path to use for generating a database, if supported.
Xapian::WritableDatabase get_writable_database(const std::string &name, const std::string &file)
Create a Xapian::WritableDatabase object.
void compact(const std::string &output, unsigned flags=0, int block_size=0)
Produce a compact version of this database.
std::string get_compaction_output_path(const std::string &name)
Get a path to compact a database to.
std::string do_get_database_path(const std::vector< std::string > &files)
Get the path of the Xapian::Database instance.
BackendManager subclass for singlefile databases.
utility functions for indexing testcase data
DatabaseError indicates some sort of database related error.
const int DBCOMPACT_SINGLE_FILE
Produce a single-file database.
bool file_exists(const char *path)
Test if a file exists.
UnimplementedError indicates an attempt to use an unimplemented feature.