xapian-core  2.0.0
dbfactory.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2005,2006,2007,2008,2009,2011,2013,2014,2016,2024 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, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef XAPIAN_INCLUDED_DBFACTORY_H
22 #define XAPIAN_INCLUDED_DBFACTORY_H
23 
24 #if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD
25 # error Never use <xapian/dbfactory.h> directly; include <xapian.h> instead.
26 #endif
27 
28 #include <string>
29 #include <string_view>
30 
31 #include <xapian/constants.h>
32 #include <xapian/database.h>
33 #include <xapian/deprecated.h>
34 #include <xapian/types.h>
35 #include <xapian/version.h>
36 #include <xapian/visibility.h>
37 
38 namespace Xapian {
39 
40 #ifdef XAPIAN_HAS_REMOTE_BACKEND
42 namespace Remote {
43 
64 Database open(std::string_view host,
65  unsigned int port,
66  unsigned timeout = 10000,
67  unsigned connect_timeout = 10000);
68 
89 WritableDatabase open_writable(std::string_view host,
90  unsigned int port,
91  unsigned timeout = 0,
92  unsigned connect_timeout = 10000,
93  int flags = 0);
94 
110 Database open(std::string_view program,
111  std::string_view args,
112  unsigned timeout = 10000);
113 
129 WritableDatabase open_writable(std::string_view program,
130  std::string_view args,
131  unsigned timeout = 0,
132  int flags = 0);
133 
134 }
135 #endif
136 
137 }
138 
139 #endif /* XAPIAN_INCLUDED_DBFACTORY_H */
An indexed database of documents.
Definition: database.h:75
This class provides read/write access to a database.
Definition: database.h:964
Constants in the Xapian namespace.
An indexed database of documents.
Define XAPIAN_DEPRECATED() and related macros.
WritableDatabase open_writable(std::string_view host, unsigned int port, unsigned timeout=0, unsigned connect_timeout=10000, int flags=0)
Construct a WritableDatabase object for update access to a remote database accessed via a TCP connect...
Database open(std::string_view host, unsigned int port, unsigned timeout=10000, unsigned connect_timeout=10000)
Construct a Database object for read-only access to a remote database accessed via a TCP connection.
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:82
typedefs for Xapian
Define preprocessor symbols for the library version.
Define XAPIAN_VISIBILITY_* macros.
#define XAPIAN_VISIBILITY_DEFAULT
Definition: visibility.h:28