oestream

class oestream

This class represents oestream.

The oestream class is the base class which sets up the platform independent interface for streaming any type of data.

The following classes derive from this class:

Constructors

oestream()

Creates an instance of an oestream. This class exists solely to provide an interface, therefore, instances of this class have no independently meaningful functionality.

operator bool

operator bool() const

Evaluates the stream to a Boolean value based on whether the end of the stream has been reached. This is equivalent to !eof().

eof

bool eof() const

Returns whether the end of the stream has been reached.

length

oefpos_t length()

Returns the number of bytes that have been read from or written to the stream in the last read or write call.

rewind

bool rewind()

Sets the data pointer position in the stream to the beginning of the stream.

seek

bool seek(oefpos_t pos)
bool seek(oefpos_t offset, seek_dir dir)

Sets the current position of the data pointer. This is accomplished by specifying the desired position or by specifying an offset distance and a directionality from the current position. Directionality is specified using the following enumeration:

enum seek_dir { beg = 0, cur = 1, end = 2 };

size

oefpos_t size()

If possible, returns the size of the stream in bytes. For oeostreams this is always zero.

Note

For oeistreams this may not be possible to calculate without reading, e.g., when the stream is a socket or pipe. In this case the implementation may return 0.

tell

oefpos_t tell() const

Returns the current position of the data pointer in the stream.