21 #ifndef XAPIAN_INCLUDED_GLASS_POSITIONLIST_H
22 #define XAPIAN_INCLUDED_GLASS_POSITIONLIST_H
63 void set_data(std::string_view data);
127 std::string_view
term);
154 std::string_view
term) {
155 std::string pos_data;
171 std::string_view s) {
185 std::string_view
term)
const;
Classes to encode/decode a bitstream.
Base-class for a position list in a glass database.
GlassBasePositionList()
Default constructor.
bool next()
Advance to the next term position in the list.
BitReader rd
Interpolative decoder.
bool skip_to(Xapian::termpos termpos)
Advance to the first term position which is at least termpos.
bool have_started
Have we started iterating yet?
Xapian::termpos get_position() const
Returns current position.
Xapian::termcount get_approx_size() const
Returns size of position list.
GlassBasePositionList(const GlassBasePositionList &)=delete
Copying is not allowed.
Xapian::termpos current_pos
Current entry.
void set_data(std::string_view data)
Set positional data and start to decode it.
Xapian::termpos last
Last entry.
GlassBasePositionList & operator=(const GlassBasePositionList &)=delete
Assignment is not allowed.
Xapian::termcount size
Number of entries.
Xapian::termpos back() const
Return the final entry in this positionlist.
A cursor pointing to a position in a Btree table, for reading several entries in order,...
void set_positionlist(Xapian::docid did, std::string_view tname, std::string_view s)
Set the position list for term tname in document did.
Xapian::termcount positionlist_count(std::string_view data) const
Return the number of entries in specified position list data.
void pack(std::string &s, const Xapian::VecCOW< Xapian::termpos > &vec) const
Pack a position list into a string.
GlassPositionList * open_position_list(Xapian::docid did, std::string_view term)
GlassPositionListTable(const std::string &dbdir, bool readonly)
Create a new GlassPositionListTable object.
void delete_positionlist(Xapian::docid did, std::string_view tname)
Delete the position list for term tname in document did.
static std::string make_key(Xapian::docid did, std::string_view term)
GlassPositionListTable(int fd, off_t offset_, bool readonly_)
A position list in a glass database.
GlassPositionList(const GlassPositionList &)=delete
Copying is not allowed.
GlassPositionList & operator=(const GlassPositionList &)=delete
Assignment is not allowed.
std::string pos_data
The encoded positional data being read by rd.
A reusable position list in a glass database.
void assign_data(std::string &&data)
Fill list with data, and move the position to the start.
GlassRePositionList(const GlassTable *table)
Constructor.
GlassRePositionList(const GlassRePositionList &)=delete
Copying is not allowed.
void read_data(Xapian::docid did, std::string_view term)
Fill list with data, and move the position to the start.
GlassCursor cursor
Cursor for locating multiple entries efficiently.
GlassRePositionList & operator=(const GlassRePositionList &)=delete
Assignment is not allowed.
Class managing a Btree table in a Glass database.
bool get_exact_entry(std::string_view key, std::string &tag) const
Read an entry from the table, if and only if it is exactly that being asked for.
bool del(std::string_view key)
Delete an entry from the table.
void add(std::string_view key, std::string_view tag, bool already_compressed=false)
Add a key/tag pair to the table, replacing any existing pair with the same key.
Read a stream created by BitWriter.
Abstract base class for iterating term positions in a document.
Suitable for "simple" type T.
Interface to Btree cursors.
Subclass of GlassTable for deriving lazy tables from.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Pack types into strings and unpack them again.
void pack_string_preserving_sort(std::string &s, std::string_view value, bool last=false)
Append an encoded std::string to a string, preserving the sort order.
void pack_uint_preserving_sort(std::string &s, U value)
Append an encoded unsigned integer to a string, preserving the sort order.
Abstract base class for iterating term positions in a document.