xapian-core
1.4.26
|
Create a stream to which non-byte-aligned values can be written. More...
#include <bitstream.h>
Public Member Functions | |
BitWriter () | |
Construct empty. More... | |
BitWriter (const std::string &seed) | |
Construct with the contents of seed already in the stream. More... | |
void | encode (Xapian::termpos value, Xapian::termpos outof) |
Encode value, known to be less than outof. More... | |
std::string & | freeze () |
Finish encoding and return the encoded data as a std::string. More... | |
void | encode_interpolative (const std::vector< Xapian::termpos > &pos, int j, int k) |
Perform interpolative encoding of pos elements between j and k. More... | |
Private Attributes | |
std::string | buf |
int | n_bits |
Xapian::termpos | acc |
Create a stream to which non-byte-aligned values can be written.
Definition at line 33 of file bitstream.h.
|
inline |
Construct empty.
Definition at line 40 of file bitstream.h.
|
inlineexplicit |
Construct with the contents of seed already in the stream.
Definition at line 43 of file bitstream.h.
References encode().
void Xapian::BitWriter::encode | ( | Xapian::termpos | value, |
Xapian::termpos | outof | ||
) |
Encode value, known to be less than outof.
Definition at line 95 of file bitstream.cc.
References Assert, highest_order_bit(), and Xapian::safe_shl().
Referenced by BitWriter(), GlassPositionListTable::pack(), and ChertPositionListTable::set_positionlist().
void Xapian::BitWriter::encode_interpolative | ( | const std::vector< Xapian::termpos > & | pos, |
int | j, | ||
int | k | ||
) |
Perform interpolative encoding of pos elements between j and k.
Definition at line 157 of file bitstream.cc.
References GeoEncode::encode().
Referenced by freeze(), GlassPositionListTable::pack(), and ChertPositionListTable::set_positionlist().
|
inline |
Finish encoding and return the encoded data as a std::string.
Definition at line 50 of file bitstream.h.
References buf, and encode_interpolative().
Referenced by GlassPositionListTable::pack(), and ChertPositionListTable::set_positionlist().
|
private |
Definition at line 36 of file bitstream.h.
|
private |
Definition at line 34 of file bitstream.h.
Referenced by freeze().
|
private |
Definition at line 35 of file bitstream.h.