xapian-core  1.4.26
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 
28 BackendManagerInMemory::do_get_database(const vector<string>& files)
29 {
31  index_files_to_database(wdb, files);
32  // This cast avoids a -Wreturn-std-move warning from older clang (seen
33  // with clang 8 and 11; not seen with clang 13). We can't address this
34  // by adding the suggested std::move() because GCC 13 -Wredundant-move
35  // then warns that the std::move() is redundant!
36  return static_cast<Xapian::Database>(wdb);
37 }
38 
41  const string& file)
42 {
44  index_files_to_database(wdb, vector<string>(1, file));
45  return wdb;
46 }
47 
48 string
50 {
51  return string();
52 }
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:789
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.