Output binary stream. More...


Public Member Functions | |
OBinaryStream () | |
OBinaryStream (std::size_t size) | |
void | open (std::size_t size) |
void | setSize (std::size_t size) override |
void | squeeze () |
void | write (const char *data, std::size_t size) |
![]() | |
char * | data () |
const char * | data () const |
bool | eof () const |
std::size_t | getCapacity () const |
int | getChunkCount () |
int | getChunkSize () |
std::size_t | getSize () const |
bool | seekg (std::size_t pos) |
bool | seekg (std::streamoff offset, std::ios_base::seekdir way) |
std::streampos | tellg () const |
Friends | |
template<typename T> | |
OBinaryStream & | operator<<) (OBinaryStream &stream, const T &data) |
Additional Inherited Members | |
![]() | |
BinaryStream () | |
BinaryStream (const char *buffer, std::size_t capacity) | |
BinaryStream (const std::vector< char > &buffer) | |
BinaryStream (std::size_t capacity) | |
void | open (const char *buffer, std::size_t capacity) |
void | open (std::size_t capacity) |
void | setCapacity (std::size_t capacity) |
![]() | |
std::vector< char > | m_buffer |
std::size_t | m_pos |
std::size_t | m_size |
Detailed Description
Output binary stream.
Definition at line 143 of file binary_stream.hpp.
Constructor & Destructor Documentation
◆ OBinaryStream() [1/2]
bitpit::OBinaryStream::OBinaryStream | ( | ) |
◆ OBinaryStream() [2/2]
bitpit::OBinaryStream::OBinaryStream | ( | std::size_t | size | ) |
Constructor.
Initialize a binary stream with the specified size. If the specified size if different from zero, the buffer capacity will be set equal to its size and the automatic expansion of the buffer wil be disabled.
- Parameters
-
[in] size is the size of the stream
Definition at line 458 of file binary_stream.cpp.
Member Function Documentation
◆ open()
void bitpit::OBinaryStream::open | ( | std::size_t | size | ) |
Open a binary stream with the specified size.
If the specified size if different from zero, the buffer capacity will be set equal to its size and the automatic expansion of the buffer wil be disabled.
- Parameters
-
[in] size is the buffer size
Definition at line 472 of file binary_stream.cpp.
◆ setSize()
|
overridevirtual |
Set the size of the stream, expressed in bytes.
If the buffer is not expandable an exception is thrown.
- Parameters
-
[in] size is the new size (in bytes) of the stream
Reimplemented from bitpit::BinaryStream.
Definition at line 491 of file binary_stream.cpp.
◆ squeeze()
void bitpit::OBinaryStream::squeeze | ( | ) |
Requests the stream to reduce its size to fit the data currently contained in the stream.
Definition at line 504 of file binary_stream.cpp.
◆ write()
void bitpit::OBinaryStream::write | ( | const char * | data, |
std::size_t | size ) |
Write data into the stream.
- Parameters
-
[in] data is the memory that contain the data [in] size is the size (in bytes) of the data to be written into the stream
Definition at line 525 of file binary_stream.cpp.
The documentation for this class was generated from the following files:
- src/containers/binary_stream.hpp
- src/containers/binary_stream.cpp
