22 #ifndef XAPIAN_INCLUDED_PREFIX_COMPRESSED_STRINGS_H
23 #define XAPIAN_INCLUDED_PREFIX_COMPRESSED_STRINGS_H
34 #define MAGIC_XOR_VALUE 96
37 const unsigned char *
p;
42 const std::string ¤t_)
50 :
p(reinterpret_cast<const unsigned char *>(s.data())),
64 const unsigned char * old_p =
p;
65 size_t old_left =
left;
66 std::string old_current =
current;
82 current.append(
reinterpret_cast<const char *
>(
p + 1), add);
105 size_t len = std::min(
current.size(), word.size());
107 for (i = 0; i < len; ++i) {
108 if (
current[i] != word[i])
break;
112 out.append(word.data() + i, word.size() - i);
PrefixCompressedStringItor & operator++()
const std::string & operator*() const
PrefixCompressedStringItor(const unsigned char *p_, size_t left_, const std::string ¤t_)
PrefixCompressedStringItor(PrefixCompressedStringItor &&o)
PrefixCompressedStringItor operator++(int)
PrefixCompressedStringItor(const std::string &s)
void append(const std::string &word)
PrefixCompressedStringWriter(std::string &out_)
DatabaseCorruptError indicates database corruption was detected.
Hierarchy of classes which Xapian can throw as exceptions.
bool operator()(const PrefixCompressedStringItor *a, const PrefixCompressedStringItor *b) const
Return true if and only if a's string is strictly greater than b's.