Cache compiled regexps used in $transform
[xapian.git] / xapian-bindings / xapian-head.i
blob7731ed2c63d5014f0d965ba66d79f1680b3d5217
1 %{
2 /** @file xapian-head.i
3 * @brief Header for SWIG interface file for Xapian.
4 */
5 /* Copyright (C) 2005,2006,2007,2008,2009,2011,2012,2013,2014,2015 Olly Betts
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20 * USA
23 // Disable any deprecation warnings for Xapian methods/functions/classes.
24 #define XAPIAN_DEPRECATED(D) D
26 #include <xapian.h>
28 #include <fstream>
29 #include <iostream>
30 #include <string>
31 #include <vector>
33 using namespace std;
35 // If a backend has been disabled in xapian-core (manually or automatically) we
36 // include a stub definition here so the bindings can still be built.
37 namespace Xapian {
39 #ifndef XAPIAN_BINDINGS_SKIP_DEPRECATED_DB_FACTORIES
42 #ifndef XAPIAN_HAS_CHERT_BACKEND
43 namespace Chert {
44 static Database open(const string &) {
45 throw FeatureUnavailableError("Chert backend not supported");
47 static WritableDatabase open(const string &, int, int = 8192) {
48 throw FeatureUnavailableError("Chert backend not supported");
51 #endif
54 #endif
56 #ifndef XAPIAN_HAS_INMEMORY_BACKEND
57 namespace InMemory {
58 static WritableDatabase open() {
59 throw FeatureUnavailableError("InMemory backend not supported");
62 #endif
64 #ifndef XAPIAN_HAS_REMOTE_BACKEND
65 namespace Remote {
66 static Database open(const string &, unsigned int, useconds_t = 0, useconds_t = 0) {
67 throw FeatureUnavailableError("Remote backend not supported");
70 static WritableDatabase open_writable(const string &, unsigned int, useconds_t = 0, useconds_t = 0) {
71 throw FeatureUnavailableError("Remote backend not supported");
74 static Database open(const string &, const string &, useconds_t = 0) {
75 throw FeatureUnavailableError("Remote backend not supported");
78 static WritableDatabase open_writable(const string &, const string &, useconds_t = 0) {
79 throw FeatureUnavailableError("Remote backend not supported");
82 #endif
86 using namespace std;
88 %include exception.i
89 %include stl.i
91 // Disable errors about not including headers individually.
92 #define XAPIAN_IN_XAPIAN_H
94 // Define these away for SWIG's parser.
95 #define XAPIAN_DEPRECATED(D) D
96 #define XAPIAN_DEPRECATED_EX(D) D
97 #define XAPIAN_DEPRECATED_CLASS
98 #define XAPIAN_DEPRECATED_CLASS_EX
99 #define XAPIAN_VISIBILITY_DEFAULT
100 #define XAPIAN_CONST_FUNCTION
101 #define XAPIAN_PURE_FUNCTION
102 #define XAPIAN_NOEXCEPT
103 #define XAPIAN_NOTHROW(D) D
105 // Ignore these which SWIG seems to add pointless type entries for due them
106 // being used in the SWIG typemap for std::pair.
107 %ignore first_type;
108 %ignore second_type;
110 // Treat POSIX useconds_t as unsigned.
111 %apply unsigned { useconds_t };