30 #define CACHE_DIRECTORY ".glass" 33 #define BLOCK_SIZE 2048 46 for (
const string& file : files) {
54 string tmp_path = db_path +
".tmp";
61 if (rename(tmp_path.c_str(), db_path.c_str()) < 0) {
std::string get_compaction_output_path(const std::string &name)
Get a path to compact a database to.
const int DB_CREATE
Create a new database.
C++ function versions of useful Unix commands.
Utility functions for testing files.
std::string do_get_database_path(const std::vector< std::string > &files)
Get the path of Glass Xapian::Database instance.
std::string get_writable_database_path_again()
Get the path of the last opened WritableDatabase.
const int DB_BACKEND_GLASS
Use the glass backend.
void rm_rf(const string &filename)
Remove a directory and contents, just like the Unix "rm -rf" command.
bool create_dir_if_needed(const std::string &dirname)
Create the directory dirname if needed.
Xapian::WritableDatabase get_writable_database(const std::string &name, const std::string &file)
Create a Glass Xapian::WritableDatabase object indexing a single file.
const int DB_OPEN
Open an existing database.
This class provides read/write access to a database.
BackendManagerGlass(const BackendManagerGlass &)
Don't allow copying.
BackendManager subclass for glass databases.
std::string get_writable_database_path(const std::string &name)
Get the path of Glass Xapian::WritableDatabase instance.
bool dir_exists(const char *path)
Test if a directory exists.
Xapian::WritableDatabase get_writable_database_again()
Create a WritableDatabase object for the last opened WritableDatabase.
std::string last_wdb_name
The path of the last writable database used.
std::string get_generated_database_path(const std::string &name)
Get the path to use for generating a database, if supported.
DatabaseError indicates some sort of database related error.
virtual void close()
Close the database.
void index_files_to_database(Xapian::WritableDatabase &database, const std::vector< std::string > &files)
Index data from zero or more text files into a database.