2 * @brief BackendManager subclass for glass databases.
4 /* Copyright (C) 2007,2008,2009,2018 Olly Betts
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef XAPIAN_INCLUDED_BACKENDMANAGER_GLASS_H
22 #define XAPIAN_INCLUDED_BACKENDMANAGER_GLASS_H
24 #include "backendmanager.h"
28 #include <xapian/types.h>
29 #include <xapian/postingiterator.h>
31 /// BackendManager subclass for glass databases.
32 class BackendManagerGlass
: public BackendManager
{
33 /// Don't allow assignment.
34 void operator=(const BackendManagerGlass
&);
36 /// Don't allow copying.
37 BackendManagerGlass(const BackendManagerGlass
&);
39 /// The path of the last writable database used.
40 std::string last_wdb_name
;
42 /// Get the path of Glass Xapian::Database instance.
43 std::string
do_get_database_path(const std::vector
<std::string
> & files
);
46 BackendManagerGlass(const std::string
& datadir_
);
48 /// Return a string representing the current database type.
49 std::string
get_dbtype() const;
51 /// Create a Glass Xapian::WritableDatabase object indexing a single file.
52 Xapian::WritableDatabase
get_writable_database(const std::string
& name
,
53 const std::string
& file
);
55 /// Get the path of Glass Xapian::WritableDatabase instance.
56 std::string
get_writable_database_path(const std::string
& name
);
58 std::string
get_compaction_output_path(const std::string
& name
);
60 /// Get the path to use for generating a database, if supported.
61 std::string
get_generated_database_path(const std::string
& name
);
63 /// Create a WritableDatabase object for the last opened WritableDatabase.
64 Xapian::WritableDatabase
get_writable_database_again();
66 /// Get the path of the last opened WritableDatabase.
67 std::string
get_writable_database_path_again();
70 #endif // XAPIAN_INCLUDED_BACKENDMANAGER_GLASS_H