xapian-core  1.4.19
backendmanager_inmemory.cc
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2009,2018 Olly Betts
5  *
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.
10  *
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.
15  *
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
19  */
20 
21 #include <config.h>
22 
24 
25 using namespace std;
26 
27 std::string
29 {
30  return "inmemory";
31 }
32 
34 BackendManagerInMemory::do_get_database(const vector<string>& files)
35 {
37  index_files_to_database(wdb, files);
38  return std::move(wdb);
39 }
40 
43  const string& file)
44 {
46  index_files_to_database(wdb, vector<string>(1, file));
47  return wdb;
48 }
49 
50 string
52 {
53  return string();
54 }
const int DB_BACKEND_INMEMORY
Use the "in memory" backend.
Definition: constants.h:195
Xapian::Database do_get_database(const std::vector< std::string > &files)
Create a InMemory Xapian::Database object indexing multiple files.
Xapian::WritableDatabase get_writable_database(const std::string &name, const std::string &file)
Create a InMemory Xapian::WritableDatabase object indexing a single file.
This class is used to access a database, or a group of databases.
Definition: database.h:68
STL namespace.
This class provides read/write access to a database.
Definition: database.h:785
std::string get_dbtype() const
Return a string representing the current database type.
std::string get_generated_database_path(const std::string &name)
Get the path to use for generating a database, if supported.
BackendManager subclass for inmemory databases.