35 KeyMaker::~KeyMaker() { }
42 auto i = slots.begin();
44 if (
rare(i == slots.end()))
return result;
46 size_t last_not_empty_forwards = 0;
53 bool reverse_sort = i->reverse;
59 if (reverse_sort || !v.empty())
60 last_not_empty_forwards = result.size();
62 if (++i == slots.end() && !reverse_sort) {
65 result.resize(last_not_empty_forwards);
77 for (string::const_iterator j = v.begin(); j != v.end(); ++j) {
78 unsigned char ch =
static_cast<unsigned char>(*j);
79 result += char(255 - ch);
80 if (ch == 0) result +=
'\0';
82 result.append(
"\xff\xff", 2);
83 if (i == slots.end())
break;
84 last_not_empty_forwards = result.size();
89 string::size_type j = 0, nul;
90 while ((nul = v.find(
'\0', j)) != string::npos) {
92 result.append(v, j, nul - j);
96 result.append(v, j, string::npos);
98 last_not_empty_forwards = result.size();
99 result.append(
"\0", 2);
The Xapian namespace contains public interfaces for the Xapian library.
Build key strings for MSet ordering or collapsing.
API for working with documents.
std::string get_value(Xapian::valueno slot) const
Get value by number.
A handle representing a document in a Xapian database.