#include <Stream.h>
Public Member Functions | |
~StreamWriter (void) | |
StreamWriter (void) | |
void | init (IO *io, bool open, size_t bufferSize=DefaultBufferSize) |
Initalize the writer. | |
void | open (size_t bufferSize=DefaultBufferSize) |
Open the IO object. | |
void | close (bool doFlush=true) |
Close the IO object. | |
void | flush (void) |
Flush the memory buffer. | |
void | seek (offset_type offset, Mode whence) |
Set the file offset. | |
offset_type | tell (void) |
Get the current file offset. | |
size_t | write (const void *buf, size_t nbytes) |
Write data. | |
template<typename TYPE> | |
bool | put_le (TYPE value) |
Write little endian data. | |
template<typename TYPE> | |
bool | put_be (TYPE value) |
Write little endian data. | |
bool | put_str (const char *str, size_t length=static_cast< size_t >(-1)) |
Write a string. | |
bool | copy (IO *io, offset_type offset, offset_type length) |
Copy data from an IO object. | |
bool | copy (IO::Location &location) |
Copy data from an IO object. | |
bool | copy (StreamReader &stream, offset_type length) |
Copy data from an ReaderStream. |
Definition at line 204 of file Stream.h.
StreamWriter::~StreamWriter | ( | void | ) |
StreamWriter::StreamWriter | ( | void | ) |
void StreamWriter::init | ( | IO * | io, | |
bool | open, | |||
size_t | bufferSize = DefaultBufferSize | |||
) |
void StreamWriter::open | ( | size_t | bufferSize = DefaultBufferSize |
) |
void StreamWriter::close | ( | bool | doFlush = true |
) |
This method flushs any buffered data if doFlush is true and then closes the underlying IO object.
void StreamWriter::flush | ( | void | ) |
This method wirtes any buffered data to the IO object.
void StreamWriter::seek | ( | offset_type | offset, | |
Mode | whence | |||
) |
This method flushs any beffered data then sets the file offset. See Mode for offset origin.
offset | number bytes to move | |
whence | the origin of movement |
offset_type StreamWriter::tell | ( | void | ) |
This method get the current file offset.
size_t StreamWriter::write | ( | const void * | buf, | |
size_t | nbytes | |||
) |
bool StreamWriter::put_le | ( | TYPE | value | ) | [inline] |
This method writes sizeof(TYPE) bytes in little endian format.
value | the source value |
Definition at line 283 of file Stream.h.
References HOST_IS_BIG_ENDIAN, and write().
bool StreamWriter::put_be | ( | TYPE | value | ) | [inline] |
This method writes sizeof(TYPE) bytes in big endian format.
value | the source value |
Definition at line 298 of file Stream.h.
References HOST_IS_LITTLE_ENDIAN, and write().
bool StreamWriter::put_str | ( | const char * | str, | |
size_t | length = static_cast< size_t >(-1) | |||
) |
This method writes the string with given lenght.
str | the source string | |
length | the number of bytes to write if lenght is -1 put_str() uses the null terminator length. |
bool StreamWriter::copy | ( | IO * | io, | |
offset_type | offset, | |||
offset_type | length | |||
) |
This method copies length bytes for io at offset.
io | the source IO object | |
offset | the byte offset to source data | |
length | the number of bytes to copy |
bool StreamWriter::copy | ( | IO::Location & | location | ) |
This method copies the data pointed to by location.
location | the location of the data |
bool StreamWriter::copy | ( | StreamReader & | stream, | |
offset_type | length | |||
) |
This method copies the next length bytes from stream
stream | the source stream | |
length | the number of bytes to copy |
LizardTech |