-
Notifications
You must be signed in to change notification settings - Fork 281
/
xapian-head.i
88 lines (77 loc) · 2.72 KB
/
xapian-head.i
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
%{
/** @file xapian-head.i
* @brief Header for SWIG interface file for Xapian.
*/
/* Copyright (C) 2005,2006,2007,2008 Olly Betts
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*/
// Disable any deprecation warnings for Xapian methods/functions/classes.
#define XAPIAN_DEPRECATED(D) D
#include <xapian.h>
#include <xapian/replication.h>
#include <string>
#include <vector>
using namespace std;
// If a backend has been disabled in xapian-core (manually or automatically) we
// include a stub definition here so the bindings can still be built.
namespace Xapian {
#ifndef XAPIAN_HAS_CHERT_BACKEND
namespace Chert {
static Database open(const string &) {
throw FeatureUnavailableError("Chert backend not supported");
}
static WritableDatabase open(const string &, int, int = 8192) {
throw FeatureUnavailableError("Chert backend not supported");
}
}
#endif
#ifndef XAPIAN_HAS_FLINT_BACKEND
namespace Flint {
static Database open(const string &) {
throw FeatureUnavailableError("Flint backend not supported");
}
static WritableDatabase open(const string &, int, int = 8192) {
throw FeatureUnavailableError("Flint backend not supported");
}
}
#endif
#ifndef XAPIAN_HAS_INMEMORY_BACKEND
namespace InMemory {
static WritableDatabase open() {
throw FeatureUnavailableError("InMemory backend not supported");
}
}
#endif
#ifndef XAPIAN_HAS_REMOTE_BACKEND
namespace Remote {
static Database open(const string &, unsigned int, timeout = 0, timeout = 0) {
throw FeatureUnavailableError("Remote backend not supported");
}
static WritableDatabase open_writable(const string &, unsigned int, timeout = 0, timeout = 0) {
throw FeatureUnavailableError("Remote backend not supported");
}
static Database open(const string &, const string &, timeout = 0) {
throw FeatureUnavailableError("Remote backend not supported");
}
static WritableDatabase open_writable(const string &, const string &, timeout = 0) {
throw FeatureUnavailableError("Remote backend not supported");
}
}
#endif
}
%}
/* vim:set syntax=cpp:set noexpandtab: */