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 
30 namespace ept {
31 
46 namespace axi {
47 
48 // Allocate value indexes for known values
49 const Xapian::valueno VAL_APT_INSTALLED_SIZE = 1;
50 const Xapian::valueno VAL_APT_PACKAGE_SIZE = 2;
51 const Xapian::valueno VAL_POPCON = 10;
52 const Xapian::valueno VAL_ITERATING_RATING = 20;
53 const Xapian::valueno VAL_ITERATING_FUNCTIONALITY = 21;
54 const Xapian::valueno VAL_ITERATING_USABILITY = 22;
55 const Xapian::valueno VAL_ITERATING_SECURITY = 23;
56 const Xapian::valueno VAL_ITERATING_PERFORMANCE = 24;
57 const Xapian::valueno VAL_ITERATING_QUALITY = 25;
58 const Xapian::valueno VAL_ITERATING_SUPPORT = 26;
59 const 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 
64 std::string path_dir();
65 
67 std::string path_db();
68 
70 time_t timestamp();
71 
72 
78 {
79  std::string old;
80 public:
81  OverrideIndexDir(const std::string& path);
83 };
84 
85 }
86 }
87 
88 // vim:set ts=4 sw=4:
89 #endif
sys.h
ept::axi::VAL_ITERATING_RATING
const Xapian::valueno VAL_ITERATING_RATING
Definition: axi.h:52
ept::axi::timestamp
time_t timestamp()
Return the last update timestamp of the index.
Definition: axi.cc:48
ept::axi::OverrideIndexDir::~OverrideIndexDir
~OverrideIndexDir()
Definition: axi.cc:60
ept::axi::OverrideIndexDir
RAII temporary override of the location of the index root directory, used for tests.
Definition: axi.h:77
string.h
ept::sys::rmdir
void rmdir(const std::string &pathname)
Remove the directory using rmdir(2)
Definition: sys.cc:770
ept::axi::path_db
std::string path_db()
Return the path to the Apt Xapian index Xapian database.
Definition: axi.cc:43
ept::tests
Definition: tests.cc:23
register_tests
void register_tests() override
Definition: axi-test.cc:90
ept::axi::VAL_ITERATING_SECURITY
const Xapian::valueno VAL_ITERATING_SECURITY
Definition: axi.h:55
ept::str::joinpath
std::string joinpath(const std::string &path1, const std::string &path2)
Definition: string.cc:97
ept
String functions.
Definition: apt.cc:40
ept::axi::VAL_APT_PACKAGE_SIZE
const Xapian::valueno VAL_APT_PACKAGE_SIZE
Definition: axi.h:50
ept::axi::VAL_APT_INSTALLED_SIZE
const Xapian::valueno VAL_APT_INSTALLED_SIZE
Definition: axi.h:49
apt.h
ept::axi::VAL_ITERATING_SUPPORT
const Xapian::valueno VAL_ITERATING_SUPPORT
Definition: axi.h:58
ept::axi::VAL_ITERATING_PERFORMANCE
const Xapian::valueno VAL_ITERATING_PERFORMANCE
Definition: axi.h:56
ept::apt::tests
struct ept::apt::AptImplementation tests
ept::tests::actual
Actual< A > actual(const A &actual)
Definition: tests.h:320
ept::sys::mkdir_ifmissing
void mkdir_ifmissing(const char *pathname, mode_t mode)
Create the given directory, if it does not already exists.
Definition: sys.cc:721
test.h
ept::axi::VAL_ITERATING_USABILITY
const Xapian::valueno VAL_ITERATING_USABILITY
Definition: axi.h:54
ept::tests::TestCase
Test case collecting several test methods, and self-registering with the singleton instance of TestRe...
Definition: tests.h:614
ept::axi::VAL_ITERATING_QUALITY
const Xapian::valueno VAL_ITERATING_QUALITY
Definition: axi.h:57
axi.h
std
Definition: packagerecord-test.cc:4
ept::apt::Apt
High-level access to the Apt cache, as a data provider for the ept framework.
Definition: apt.h:120
ept::axi::VAL_ITERATING_FUNCTIONALITY
const Xapian::valueno VAL_ITERATING_FUNCTIONALITY
Definition: axi.h:53
ept::tests::TestCase::TestCase
TestCase(const std::string &name)
Definition: tests.h:622
wassert
#define wassert(...)
Run the given command, raising TestFailed with the appropriate backtrace information if it threw an e...
Definition: tests.h:343
ept::axi::VAL_POPCON
const Xapian::valueno VAL_POPCON
Definition: axi.h:51
ept::axi::OverrideIndexDir::OverrideIndexDir
OverrideIndexDir(const std::string &path)
Definition: axi.cc:55
ept::axi::path_dir
std::string path_dir()
Return the path to the Apt Xapian index root directory.
Definition: axi.cc:38
ept::axi::VAL_ITERATING_ADOPTION
const Xapian::valueno VAL_ITERATING_ADOPTION
Definition: axi.h:59