libept
axi.h
Go to the documentation of this file.
1#ifndef EPT_TEXTSEARCH_TEXTSEARCH_H
2#define EPT_TEXTSEARCH_TEXTSEARCH_H
3
9/*
10 * Copyright (C) 2007 Enrico Zini <enrico@debian.org>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27#include <xapian.h>
28#include <string>
29
30namespace ept {
31
46namespace axi {
47
48// Allocate value indexes for known values
49const Xapian::valueno VAL_APT_INSTALLED_SIZE = 1;
50const Xapian::valueno VAL_APT_PACKAGE_SIZE = 2;
51const Xapian::valueno VAL_POPCON = 10;
52const Xapian::valueno VAL_ITERATING_RATING = 20;
53const Xapian::valueno VAL_ITERATING_FUNCTIONALITY = 21;
54const Xapian::valueno VAL_ITERATING_USABILITY = 22;
55const Xapian::valueno VAL_ITERATING_SECURITY = 23;
56const Xapian::valueno VAL_ITERATING_PERFORMANCE = 24;
57const Xapian::valueno VAL_ITERATING_QUALITY = 25;
58const Xapian::valueno VAL_ITERATING_SUPPORT = 26;
59const Xapian::valueno VAL_ITERATING_ADOPTION = 27;
60// If you need to index a value and cannot edit this file, feel free to use any
61// value starting from 1000000
62
64std::string path_dir();
65
67std::string path_db();
68
70time_t timestamp();
71
72
78{
79 std::string old;
80public:
81 OverrideIndexDir(const std::string& path);
83};
84
85}
86}
87
88// vim:set ts=4 sw=4:
89#endif
RAII temporary override of the location of the index root directory, used for tests.
Definition: axi.h:78
OverrideIndexDir(const std::string &path)
Definition: axi.cc:55
~OverrideIndexDir()
Definition: axi.cc:60
const Xapian::valueno VAL_POPCON
Definition: axi.h:51
const Xapian::valueno VAL_ITERATING_RATING
Definition: axi.h:52
const Xapian::valueno VAL_APT_INSTALLED_SIZE
Definition: axi.h:49
const Xapian::valueno VAL_ITERATING_USABILITY
Definition: axi.h:54
const Xapian::valueno VAL_ITERATING_QUALITY
Definition: axi.h:57
std::string path_db()
Return the path to the Apt Xapian index Xapian database.
Definition: axi.cc:43
const Xapian::valueno VAL_ITERATING_ADOPTION
Definition: axi.h:59
const Xapian::valueno VAL_APT_PACKAGE_SIZE
Definition: axi.h:50
time_t timestamp()
Return the last update timestamp of the index.
Definition: axi.cc:48
const Xapian::valueno VAL_ITERATING_SECURITY
Definition: axi.h:55
const Xapian::valueno VAL_ITERATING_SUPPORT
Definition: axi.h:58
std::string path_dir()
Return the path to the Apt Xapian index root directory.
Definition: axi.cc:38
const Xapian::valueno VAL_ITERATING_FUNCTIONALITY
Definition: axi.h:53
const Xapian::valueno VAL_ITERATING_PERFORMANCE
Definition: axi.h:56
String functions.
Definition: apt.cc:40