22 #ifndef XAPIAN_INCLUDED_BITSTREAM_H
23 #define XAPIAN_INCLUDED_BITSTREAM_H
129 void init(
const std::string &buf_,
size_t skip = 0) {
130 buf.assign(buf_, skip, std::string::npos);
Read a stream created by BitWriter.
Xapian::termpos read_bits(int count)
std::vector< DIStack > di_stack
bool check_all_gone() const
BitReader(const std::string &buf_)
void init(const std::string &buf_, size_t skip=0)
Xapian::termpos decode(Xapian::termpos outof, bool force=false)
BitReader(const std::string &buf_, size_t skip)
void decode_interpolative(int j, int k, Xapian::termpos pos_j, Xapian::termpos pos_k)
Perform interpolative decoding between elements between j and k.
Xapian::termpos decode_interpolative_next()
Perform on-demand interpolative decoding.
Create a stream to which non-byte-aligned values can be written.
BitWriter(const std::string &seed)
Construct with the contents of seed already in the stream.
BitWriter()
Construct empty.
void encode(Xapian::termpos value, Xapian::termpos outof)
Encode value, known to be less than outof.
std::string & freeze()
Finish encoding and return the encoded data as a std::string.
void encode_interpolative(const std::vector< Xapian::termpos > &pos, int j, int k)
Perform interpolative encoding of pos elements between j and k.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Xapian::termpos outof() const
void set_j(int j_, Xapian::termpos pos_j_)
bool is_initialized() const
DIState(int j_, int k_, Xapian::termpos pos_j_, Xapian::termpos pos_k_)
void set_k(int k_, Xapian::termpos pos_k_)
void operator=(const DIStack &o)