xapian-core  1.4.20
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Xapian::BitReader Class Reference

Read a stream created by BitWriter. More...

#include <bitstream.h>

+ Collaboration diagram for Xapian::BitReader:


struct  DIStack
struct  DIState

Public Member Functions

 BitReader ()
 BitReader (const std::string &buf_)
 BitReader (const std::string &buf_, size_t skip)
void init (const std::string &buf_, size_t skip=0)
Xapian::termpos decode (Xapian::termpos outof, bool force=false)
bool check_all_gone () const
void decode_interpolative (int j, int k, Xapian::termpos pos_j, Xapian::termpos pos_k)
 Perform interpolative decoding between elements between j and k. More...
Xapian::termpos decode_interpolative_next ()
 Perform on-demand interpolative decoding. More...

Private Member Functions

Xapian::termpos read_bits (int count)

Private Attributes

std::string buf
size_t idx
int n_bits
Xapian::termpos acc
std::vector< DIStackdi_stack
DIState di_current

Detailed Description

Read a stream created by BitWriter.

Definition at line 64 of file bitstream.h.

Constructor & Destructor Documentation

◆ BitReader() [1/3]

Xapian::BitReader::BitReader ( )

Definition at line 118 of file bitstream.h.

◆ BitReader() [2/3]

Xapian::BitReader::BitReader ( const std::string &  buf_)

Definition at line 121 of file bitstream.h.

◆ BitReader() [3/3]

Xapian::BitReader::BitReader ( const std::string &  buf_,
size_t  skip 

Definition at line 125 of file bitstream.h.

Member Function Documentation

◆ check_all_gone()

bool Xapian::BitReader::check_all_gone ( ) const

Definition at line 145 of file bitstream.h.

◆ decode()

Xapian::termpos Xapian::BitReader::decode ( Xapian::termpos  outof,
bool  force = false 

◆ decode_interpolative()

void Xapian::BitReader::decode_interpolative ( int  j,
int  k,
Xapian::termpos  pos_j,
Xapian::termpos  pos_k 

Perform interpolative decoding between elements between j and k.

Definition at line 222 of file bitstream.cc.

References Assert, and highest_order_bit().

◆ decode_interpolative_next()

Xapian::termpos Xapian::BitReader::decode_interpolative_next ( )

Perform on-demand interpolative decoding.

Definition at line 232 of file bitstream.cc.

References Assert, and GeoEncode::decode().

◆ init()

void Xapian::BitReader::init ( const std::string &  buf_,
size_t  skip = 0 

Definition at line 129 of file bitstream.h.

References GeoEncode::decode(), and Xapian::BitReader::DIState::uninit().

◆ read_bits()

Xapian::termpos Xapian::BitReader::read_bits ( int  count)

Definition at line 195 of file bitstream.cc.

References Assert.

Member Data Documentation

◆ acc

Xapian::termpos Xapian::BitReader::acc

Definition at line 68 of file bitstream.h.

◆ buf

std::string Xapian::BitReader::buf

Definition at line 65 of file bitstream.h.

◆ di_current

DIState Xapian::BitReader::di_current

Definition at line 114 of file bitstream.h.

◆ di_stack

std::vector<DIStack> Xapian::BitReader::di_stack

Definition at line 113 of file bitstream.h.

◆ idx

size_t Xapian::BitReader::idx

Definition at line 66 of file bitstream.h.

◆ n_bits

int Xapian::BitReader::n_bits

Definition at line 67 of file bitstream.h.

The documentation for this class was generated from the following files: