mCRL2
|
The counterpart of obitstream, guarantees that the same data is read as has been written when calling the read operators in the same sequence as the corresponding write operators. More...
#include <bitstream.h>
Public Member Functions | |
ibitstream (std::istream &stream) | |
Provides the stream on which the read function operate. | |
std::size_t | read_bits (unsigned int num_of_bits) |
Reads an num_of_bits bits from the input stream and stores them in the least significant part (in descending order) of the return value. | |
const char * | read_string () |
std::size_t | read_integer () |
Private Member Functions | |
void | read (std::size_t size, std::uint8_t *buffer) |
Read size bytes into the provided buffer. | |
Private Attributes | |
std::istream & | stream |
std::bitset< 128 > | read_buffer = 0 |
Buffer that is filled starting from bit 127 when reading. | |
unsigned int | bits_in_buffer = 0 |
how many bits in the buffer are used. | |
std::vector< char > | m_text_buffer |
A temporary buffer to store char array strings. | |
The counterpart of obitstream, guarantees that the same data is read as has been written when calling the read operators in the same sequence as the corresponding write operators.
Definition at line 71 of file bitstream.h.
ibitstream::ibitstream | ( | std::istream & | stream | ) |
Provides the stream on which the read function operate.
Definition at line 163 of file bitstream.cpp.
|
private |
Read size bytes into the provided buffer.
Definition at line 256 of file bitstream.cpp.
std::size_t ibitstream::read_bits | ( | unsigned int | num_of_bits | ) |
Reads an num_of_bits bits from the input stream and stores them in the least significant part (in descending order) of the return value.
num_of_bits | Number of bits to read from the input stream. |
Definition at line 193 of file bitstream.cpp.
std::size_t ibitstream::read_integer | ( | ) |
Definition at line 227 of file bitstream.cpp.
const char * ibitstream::read_string | ( | ) |
Remains valid until the next call to read_string.
Definition at line 173 of file bitstream.cpp.
|
private |
how many bits in the buffer are used.
Definition at line 97 of file bitstream.h.
|
private |
A temporary buffer to store char array strings.
Definition at line 99 of file bitstream.h.
|
private |
Buffer that is filled starting from bit 127 when reading.
Definition at line 95 of file bitstream.h.
|
private |
Definition at line 92 of file bitstream.h.