Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
bitpit::IBinaryStream Class Reference

Output binary stream. More...

Inheritance diagram for bitpit::IBinaryStream:
Inheritance graph
[legend]
Collaboration diagram for bitpit::IBinaryStream:
Collaboration graph
[legend]

Public Member Functions

 IBinaryStream (const char *buffer, std::size_t size)
 
 IBinaryStream (const std::vector< char > &buffer)
 
 IBinaryStream (std::size_t size)
 
 IBinaryStream (void)
 
void open (const char *buffer, std::size_t size)
 
void open (std::size_t size)
 
void read (char *data, std::size_t size)
 
- Public Member Functions inherited from bitpit::BinaryStream
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)
 
virtual void setSize (std::size_t size)
 
std::streampos tellg () const
 

Friends

template<typename T >
IBinaryStreamoperator>>) (IBinaryStream &stream, T &value)
 

Additional Inherited Members

- Protected Member Functions inherited from bitpit::BinaryStream
 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)
 
- Protected Attributes inherited from bitpit::BinaryStream
std::vector< char > m_buffer
 
std::size_t m_pos
 
std::size_t m_size
 

Detailed Description

Output binary stream.

Definition at line 102 of file binary_stream.hpp.

Constructor & Destructor Documentation

◆ IBinaryStream() [1/4]

bitpit::IBinaryStream::IBinaryStream ( void )

Constructor.

Initialize an empty binary stream.

Definition at line 346 of file binary_stream.cpp.

◆ IBinaryStream() [2/4]

bitpit::IBinaryStream::IBinaryStream ( std::size_t size)

Constructor.

Initialize an empty binary stream with the assigned size.

Parameters
[in]sizeis the stream size

Definition at line 358 of file binary_stream.cpp.

◆ IBinaryStream() [3/4]

bitpit::IBinaryStream::IBinaryStream ( const char * buffer,
std::size_t size )

Constructor.

Initialize a binary stream with the data contained in the specified buffer. The data is copied from the input buffer to the internal buffer.

Parameters
[in]bufferis the buffer that contains the data
[in]sizeis the data size

Definition at line 372 of file binary_stream.cpp.

◆ IBinaryStream() [4/4]

bitpit::IBinaryStream::IBinaryStream ( const std::vector< char > & buffer)

Constructor.

Initialize a binary stream with the data contained in the specified buffer. The data is copied from the input buffer to the internal buffer.

Parameters
[in]bufferis the buffer that contains the data

Definition at line 385 of file binary_stream.cpp.

Member Function Documentation

◆ open() [1/2]

void bitpit::IBinaryStream::open ( const char * buffer,
std::size_t size )

Open a binary stream initializing it with the data contained in the specified buffer.

Parameters
[in]bufferis the buffer that contains the data
[in]sizeis the buffer size

Definition at line 407 of file binary_stream.cpp.

◆ open() [2/2]

void bitpit::IBinaryStream::open ( std::size_t size)

Open a binary stream with the specified size.

Parameters
[in]sizeis the buffer size

Definition at line 395 of file binary_stream.cpp.

◆ read()

void bitpit::IBinaryStream::read ( char * data,
std::size_t size )

Read data from the stream.

Parameters
[out]datais the memory location that will contain the data
[in]sizeis the size (in bytes) of the data to be read from the stream

Definition at line 419 of file binary_stream.cpp.


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