Support: quest -f cjk_ngram
[xapian.git] / xapian-core / include / xapian.h
blob815fd00bc63a02f9da14716fc857bb97f623bc3c
1 /** @file xapian.h
2 * @brief Public interfaces for the Xapian library.
3 */
4 // Copyright (C) 2003,2004,2005,2007,2008,2009,2010,2012,2013,2015 Olly Betts
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
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.
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
20 #ifndef XAPIAN_INCLUDED_XAPIAN_H
21 #define XAPIAN_INCLUDED_XAPIAN_H
23 #ifdef slots
24 # ifdef Q_OBJECT
25 // Qt headers '#define slots' by default, which clashes with us using it as a
26 // class member name. Including <xapian.h> first is a simple workaround, or
27 // you can use 'no_keywords' to stop Qt polluting the global macro namespace,
28 // as described here:
30 // http://qt-project.org/doc/qt-5.0/signalsandslots.html#using-qt-with-3rd-party-signals-and-slots
31 # error "Include <xapian.h> before Qt headers, or put 'CONFIG += no_keywords' in your .pro file and use Q_SLOTS instead of slots, etc"
32 # endif
33 # ifdef WT_API
34 // Argh, copycat polluters!
35 # error "Include <xapian.h> before Wt headers, or define WT_NO_SLOT_MACROS to stop Wt from defining the macros 'slots' and 'SLOT()'"
36 # endif
37 #endif
39 // Define so that deprecation warnings are given to API users, but not
40 // while building the library.
41 #define XAPIAN_IN_XAPIAN_H
43 // Set defines for library version and check C++ ABI versions match.
44 #include <xapian/version.h>
46 // Types
47 #include <xapian/types.h>
49 // Function attributes
50 #include <xapian/attributes.h>
52 // Constants
53 #include <xapian/constants.h>
55 // Exceptions
56 #include <xapian/error.h>
57 #include <xapian/errorhandler.h>
59 // Access to databases, documents, etc.
60 #include <xapian/database.h>
61 #include <xapian/dbfactory.h>
62 #include <xapian/document.h>
63 #include <xapian/positioniterator.h>
64 #include <xapian/postingiterator.h>
65 #include <xapian/termiterator.h>
66 #include <xapian/valueiterator.h>
68 // Indexing
69 #include <xapian/termgenerator.h>
71 // Searching
72 #include <xapian/enquire.h>
73 #include <xapian/expanddecider.h>
74 #include <xapian/keymaker.h>
75 #include <xapian/matchspy.h>
76 #include <xapian/postingsource.h>
77 #include <xapian/query.h>
78 #include <xapian/queryparser.h>
79 #include <xapian/valuesetmatchdecider.h>
80 #include <xapian/weight.h>
82 // Stemming
83 #include <xapian/stem.h>
85 // Snippets
86 #include <xapian/snipper.h>
88 // Subclass registry
89 #include <xapian/registry.h>
91 // Unicode support
92 #include <xapian/unicode.h>
94 // Geospatial
95 #include <xapian/geospatial.h>
97 // Database compaction and merging
98 #include <xapian/compactor.h>
100 // ELF visibility annotations for GCC.
101 #include <xapian/visibility.h>
103 // Mechanism for accessing a struct of constant information
104 #include <xapian/constinfo.h>
106 /// The Xapian namespace contains public interfaces for the Xapian library.
107 namespace Xapian {
109 // Functions returning library version:
111 /** Report the version string of the library which the program is linked with.
113 * This may be different to the version compiled against (given by
114 * XAPIAN_VERSION) if shared libraries are being used.
116 inline const char * version_string() {
117 return Internal::get_constinfo_()->str;
120 /** Report the major version of the library which the program is linked with.
122 * This may be different to the version compiled against (given by
123 * XAPIAN_MAJOR_VERSION) if shared libraries are being used.
125 inline int major_version() {
126 return Internal::get_constinfo_()->major;
129 /** Report the minor version of the library which the program is linked with.
131 * This may be different to the version compiled against (given by
132 * XAPIAN_MINOR_VERSION) if shared libraries are being used.
134 inline int minor_version() {
135 return Internal::get_constinfo_()->minor;
138 /** Report the revision of the library which the program is linked with.
140 * This may be different to the version compiled against (given by
141 * XAPIAN_REVISION) if shared libraries are being used.
143 inline int revision() {
144 return Internal::get_constinfo_()->revision;
149 #undef XAPIAN_IN_XAPIAN_H
151 #endif /* XAPIAN_INCLUDED_XAPIAN_H */