[omega] Compute date spans in days
[xapian.git] / xapian-bindings / xapian-head.i
blob5985fb23bfafea8639312622f61e5e4b7b4eb6d8
1 %{
2 /** @file
3 * @brief Header for SWIG interface file for Xapian.
4 */
5 /* Copyright (C) 2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017 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 the remote backend has been disabled in xapian-core (manually or
36 // automatically) we include a stub definition here so the bindings can still
37 // be built.
38 namespace Xapian {
40 #ifndef XAPIAN_HAS_REMOTE_BACKEND
41 namespace Remote {
42 static Database open(const string &, unsigned int, unsigned = 0, unsigned = 0) {
43 throw FeatureUnavailableError("Remote backend not supported");
46 static WritableDatabase open_writable(const string &, unsigned int, unsigned = 0, unsigned = 0, int = 0) {
47 throw FeatureUnavailableError("Remote backend not supported");
50 static Database open(const string &, const string &, unsigned = 0) {
51 throw FeatureUnavailableError("Remote backend not supported");
54 static WritableDatabase open_writable(const string &, const string &, unsigned = 0, int = 0) {
55 throw FeatureUnavailableError("Remote backend not supported");
58 #endif
63 using namespace std;
65 %include exception.i
66 %include stl.i
67 %include std_string_view.i
69 // Disable errors about not including headers individually.
70 #define XAPIAN_IN_XAPIAN_H
72 // Define these away for SWIG's parser.
73 #define XAPIAN_DEPRECATED(D) D
74 #define XAPIAN_DEPRECATED_EX(D) D
75 #define XAPIAN_DEPRECATED_CLASS
76 #define XAPIAN_DEPRECATED_CLASS_EX
77 #define XAPIAN_VISIBILITY_DEFAULT
78 #define XAPIAN_VISIBILITY_INTERNAL
79 #define XAPIAN_CONST_FUNCTION
80 #define XAPIAN_PURE_FUNCTION
82 // This works around buggy behaviour in SWIG's preprocessor, and only works
83 // because we currently only use XAPIAN_NONNULL() with an empty argument:
85 // https://github.com/swig/swig/pull/1111
87 // The correct version is:
88 // #define XAPIAN_NONNULL(L)
89 #define XAPIAN_NONNULL()
91 // Ignore these which SWIG seems to add pointless type entries for due them
92 // being used in the SWIG typemap for std::pair.
93 %ignore first_type;
94 %ignore second_type;