#include <gauge3d/files/ostream.h>
Inherits GAUGE3D::GObject.
Public Types | |
enum | tSeekType { BEGINNING, CURRENT, END } |
Position to seek relative to. Used by Seek(). More... | |
enum | tWriteMode { BINARY, ASCII } |
Write mode specifiers for WriteMode(). More... | |
enum | tEndianness { BIG, LITTLE } |
Endianness specifiers for Endianness(). More... | |
enum | tNumberBase { OCT = 8, DEC = 10, HEX = 16 } |
Number base specifiers for NumberBase(). More... | |
Public Methods | |
GOStream (pGRawOStream streamDest) | |
Create a buffered output stream. More... | |
GOStream (pGRawOStream streamDest,int bufferSize) | |
Create a buffered output stream. More... | |
virtual | ~GOStream () |
Destructor. | |
void | Seek (int pos,tSeekType seekType) |
Seek the stream position. More... | |
int | TellPos () |
Get the distance in bytes between the beginning of the stream and the current position. | |
int | Write (const uint64 *source,int num=1) |
Write one or more uint64's from the source buffer. Returns the number successfully written. | |
int | Write (const uint32 *source,int num=1) |
Write one or more uint32's from the source buffer. Returns the number successfully written. | |
int | Write (const uint16 *source,int num=1) |
Write one or more uint16's from the source buffer. Returns the number successfully written. | |
int | Write (const int64 *source,int num=1) |
Write one or more int64's from the source buffer. Returns the number successfully written. | |
int | Write (const int32 *source,int num=1) |
Write one or more int32's from the source buffer. Returns the number successfully written. | |
int | Write (const int16 *source,int num=1) |
Write one or more int16's from the source buffer. Returns the number successfully written. | |
int | Write (const float64 *source,int num=1) |
Write one or more float64's from the source buffer. Returns the number successfully written. | |
int | Write (const float32 *source,int num=1) |
Write one or more float32's from the source buffer. Returns the number successfully written. | |
int | Write (const char *source,int num=1) |
Write one or more char's from the source buffer. Returns the number successfully written. | |
int | Write (const char *source[],int num=1) |
Write one or more strings from the source buffer. Returns the number successfully written. More... | |
int | Write (const GString *source,int num=1) |
Write one or more strings from the source buffer. Returns the number successfully written. More... | |
int | Write (const void *source,int num) |
Write <u>num</u> bytes of raw data. | |
void | Put (char c) |
Write a character to the stream. More... | |
int | Flush () |
Write any data that is in the buffer to the output stream. More... | |
void | WriteMode (tWriteMode mode) |
tWriteMode | WriteMode () |
Get the current write mode. | |
void | Separator (char separator,bool enable) |
Specify a character to place after each item. More... | |
char | Separator () |
Get the current separator character. | |
void | Endianness (tEndianness endianness) |
Set the endianness in which to write the output data. Only applies to binary streams. | |
tEndianness | Endianness () |
Get the endianness of the output data. | |
void | NumberBase (tNumberBase base) |
Set the number base in which to write the output data. Only applies to text streams. | |
tNumberBase | NumberBase () |
Get the number base of the output data. | |
operator void * () | |
Use to check if the last write operation succeeded. | |
Related Functions | |
(Note that these are not member functions.) | |
template<class tType> GOStream & | operator<< (GOStream &os,const tType &source) |
The << operator works the same as it does for C++ ostreams. |
GOStream does not provide the stream destination itself. It wraps around a GRawOStream. GOStream provides many different ways to write the data, however, whereas GRawOStream only lets you write the data raw.
You can use a GOStream in either binary or text mode. Text mode works like regular C++ ostreams, where numbers are written as ASCII, human-readable numbers, etc. In binary mode, on the other hand, the numbers are written in actual binary code, where a 32-bit number will be exactly four bytes in size in the file. Also, when in binary mode you can set whether to write the data in big-endian or little-endian format. The data will automatically be converted from the host's endianness when written.
|
Position to seek relative to. Used by Seek().
|
|
Write mode specifiers for WriteMode().
|
|
Endianness specifiers for Endianness().
|
|
Number base specifiers for NumberBase().
|
|
Create a buffered output stream.
|
|
Create a buffered output stream.
|
|
Seek the stream position.
|
|
Write one or more strings from the source buffer. Returns the number successfully written.
|
|
Write one or more strings from the source buffer. Returns the number successfully written.
|
|
Write a character to the stream.
|
|
Write any data that is in the buffer to the output stream.
|
|
\breif Set how to output the data in the stream (binary or text).
|
|
Specify a character to place after each item.
|