#include <Iobuffer.h>
Description
Binary file writing utility.
OutputBuffers are the complement to InputBuffers. Once instantiated, the user can easily and quickly write data to the buffer in a variety of formats verbatim. Once the user is ready, they can write the buffer to either a new file or either write over or append an existing file. It is also possible to view already written data to the buffer via getData(). If they so wish, the user may also clear the entire buffer that they have written to as well.
Functions | |
bool | CommitToFile (std::string fileName, bool append) |
void | GoToByte (int n) |
std::vector< uint8_t > | GetData () |
int | Size () |
void | Clear () |
Writing Data | |
Write various kinds of data to the queued buffer. The variations are equivalent to InputBuffer's reading. | |
template<typename T > | |
void | Write (const T &) |
void | WriteBytes (const std::vector< uint8_t > &data) |
void | WriteString (std::string str) |
Member Function Documentation
bool CommitToFile | ( | std::string | fileName, |
bool | append | ||
) |
Stores the written data to the specified file.
void GoToByte | ( | int | n | ) |
Set the buffer position to the specifified byte.
std::vector<uint8_t> GetData | ( | ) |
Returns a copy of the queued data.
int Size | ( | ) |
Returns the size of the queued data in bytes.
void Clear | ( | ) |
Resets the queued data buffer.
The documentation for this class was generated from the following file:
- /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/Util/Iobuffer.h