22 #ifndef XAPIAN_INCLUDED_BITSTREAM_H 23 #define XAPIAN_INCLUDED_BITSTREAM_H 44 : buf(seed), n_bits(0), acc(0) { }
122 : buf(buf_), idx(0), n_bits(0), acc(0) { }
126 : buf(buf_, skip), idx(0), n_bits(0), acc(0) { }
129 void init(
const std::string &buf_,
size_t skip = 0) {
130 buf.assign(buf_, skip, std::string::npos);
146 return (idx == buf.size() && n_bits <= 7 && acc == 0);
150 void decode_interpolative(
int j,
int k,
162 #endif // XAPIAN_INCLUDED_BITSTREAM_H The Xapian namespace contains public interfaces for the Xapian library.
DIState(int j_, int k_, Xapian::termpos pos_j_, Xapian::termpos pos_k_)
BitWriter()
Construct empty.
static int decode(const T(&table)[N], const char *s)
Decode a string to an integer.
void operator=(const DIStack &o)
std::vector< DIStack > di_stack
void encode_interpolative(const std::vector< Xapian::termpos > &pos, int j, int k)
Perform interpolative encoding of pos elements between j and k.
void init(const std::string &buf_, size_t skip=0)
BitReader(const std::string &buf_)
bool is_initialized() const
bool check_all_gone() const
void set_j(int j_, Xapian::termpos pos_j_)
BitWriter(const std::string &seed)
Construct with the contents of seed already in the stream.
Read a stream created by BitWriter.
Xapian::termpos outof() const
void set_k(int k_, Xapian::termpos pos_k_)
BitReader(const std::string &buf_, size_t skip)
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Create a stream to which non-byte-aligned values can be written.
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.