oeostream

class oeostream : public oestream

This class represents oeostream.

Defines the platform independent interface and implementation for a generic output data stream class.

The following methods are publicly inherited from oestream:

operator bool rewind tell
eof seek  
length size  
The following classes derive from this class:

Constructors

oeostream()

Creates an instance of an oeostream. This class is designed to provide an interface and some functionality; however, this class does not define a data target and therefore writing data to an instance of this is equivalent to writing to null.

operator<<

oeostream &operator<<(oestream &(_f)(oestream &))
oeostream &operator<<(oeostream &(_f)(oeostream &))

Use of these operators executes the specified function (‘f’) on the stream in question. In order for proper compilation and execution, the specified function must be prototyped according to the API shown above.

oeostream &operator<<(oeistream &)

Fills the current stream by reading and storing all of the data from the specified oeistream stream.

oeostream &operator<<(int)
oeostream &operator<<(bool)
oeostream &operator<<(long)
oeostream &operator<<(char)
oeostream &operator<<(short)
oeostream &operator<<(float)
oeostream &operator<<(double)
oeostream &operator<<(signed char)
oeostream &operator<<(const char *)
oeostream &operator<<(unsigned int)
oeostream &operator<<(unsigned long)
oeostream &operator<<(unsigned char)
oeostream &operator<<(unsigned short)
oeostream &operator<<(const signed char *)
oeostream &operator<<(const std::string &)
oeostream &operator<<(const unsigned char *)

These operators take the specified parameter, convert it to a text representation, and then push it onto the current stream as a whitespace-delimited text token.

close

void close()

Flushes the remaining data in the output buffer and then closes the stream. After the stream has been closed, it is then initialized and ready to be opened. Before this stream can be reused, it must first be opened with oeostream.open. Any attempts to write to this stream before it has been opened will fail.

flush

bool flush()

Flushes the remaining data in the output buffer onto the stream and returns whether or not it was successful. Explicit calls to this function are only necessary when one needs to make sure that all of the data that has been stored in the output buffer is actually on the output stream at that time. The output buffer is automatically flushed when it becomes full.

open

bool open(const char *name)
bool open(const std::string &name)
bool open(unsigned char *buffer, oesize_t len)

Opens the output stream to the specified sources. Passing a ‘name’ parameter will result in invocation of a protected virtual method to appropriate handle the specified output source. Passing a pointer to a character buffer along with the buffer’s size will result in the stream wrapping the ‘buffer’ and using that as the stream data destination. Returns whether or not data can now be written to the stream.

putbyte

bool putbyte(char c)

Pushes the specified byte ‘c’ onto the output stream and returns whether or not this was successful.

write

oesize_t write(const char *buffer, oesize_t len)
oesize_t write(const std::string &buffer, oesize_t len)
oesize_t write(const signed char *buffer, oesize_t len)
oesize_t write(const unsigned char *buffer, oesize_t len)

Writes ‘len’ number of bytes from the specified data source (‘buffer’) onto the output stream and returns the number of bytes that were able to be written.