36 return clamp_cast<Xapian::termcount>(tmap->size());
44 Assert(!it->first.empty());
46 return clamp_cast<Xapian::doccount>(it->second.docs.size());
55 if (!it->first.empty()) {
57 if (term <= it->first)
return NULL;
62 }
else if (
term.empty()) {
64 while (it != tmap->end() && it->second.term_freq == 0) ++it;
65 if (it == tmap->end())
67 current_term = it->first;
71 it = tmap->lower_bound(
term);
72 while (it != tmap->end() && it->second.term_freq == 0) ++it;
73 if (it == tmap->end() || !
startswith(it->first, prefix)) {
76 current_term = it->first;
85 if (it->first.empty() && !prefix.empty()) {
86 it = tmap->lower_bound(prefix);
90 while (it != tmap->end() && it->second.term_freq == 0) ++it;
91 if (it == tmap->end() || !
startswith(it->first, prefix)) {
94 current_term = it->first;
98 #ifdef DISABLE_GPL_LIBXAPIAN
99 # error GPL source we cannot relicense included in libxapian
Cast a value to a type, clamping out of range values.
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
TermList * next()
next() causes the AllTermsList to move to the next term in the list.
TermList * skip_to(std::string_view term)
Skip forward to the specified term.
static void throw_database_closed()
Abstract base class for termlists.
Iterate all terms in an inmemory db.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Various handy string-related helpers.
bool startswith(std::string_view s, char pfx)