21 #ifndef XAPIAN_INCLUDED_PREFIX_COMPRESSED_STRINGS_H
22 #define XAPIAN_INCLUDED_PREFIX_COMPRESSED_STRINGS_H
36 #define MAGIC_XOR_VALUE 96
39 const unsigned char *
p;
63 :
p(reinterpret_cast<const unsigned char *>(s.data())),
78 const std::string& key)
79 :
p(reinterpret_cast<const unsigned char *>(s.data())),
82 unsigned char first_ch = key[0];
130 reinterpret_cast<const char *
>(
p + 1), add);
161 const std::string& key)
164 unsigned char first_ch = key[0];
194 out.append(word, -
tail, word.size() - 2);
204 i = std::min(i, word.size() -
tail);
206 size_t add = word.size() - i -
tail;
208 out.append(word.data() + i, add);
216 out.append(word, 0, word.size() -
tail);
PrefixCompressedStringItor & operator++()
PrefixCompressedStringItor(const std::string &s, const std::string &key)
Construct for honey.
const std::string & operator*() const
PrefixCompressedStringItor(PrefixCompressedStringItor &&o)
PrefixCompressedStringItor operator++(int)
int tail
Number of constant characters on the end of the value.
PrefixCompressedStringItor(const std::string &s)
Construct for glass.
PrefixCompressedStringItor(PrefixCompressedStringItor &o)
PrefixCompressedStringWriter(std::string &out_, const std::string &key)
Construct for honey.
void append(const std::string &word)
PrefixCompressedStringWriter(std::string &out_)
Construct for glass.
DatabaseCorruptError indicates database corruption was detected.
Hierarchy of classes which Xapian can throw as exceptions.
Spelling correction data for a honey database.
const unsigned KEY_PREFIX_WORD
const unsigned KEY_PREFIX_TAIL
const unsigned KEY_PREFIX_BOOKEND
const unsigned KEY_PREFIX_HEAD
#define AssertRel(A, REL, B)
Various handy string-related helpers.
std::string::size_type common_prefix_length(std::string_view a, std::string_view b)
bool operator()(const PrefixCompressedStringItor *a, const PrefixCompressedStringItor *b) const
Return true if and only if a's string is strictly greater than b's.