Go to the previous, next section.
#include <nihcl/OIOstream.h>
Class
OIOostream
is the abstract base class for classes implementing object output to
ostream
s for the
storeOn()
function. It defines virtual member functions for writing the fundamental data types, arrays of fundamental data types, and C-style (null-terminated) character strings. It also defines virtual member functions for setting and accessing the output format precision and field width.
Since all output functions are virtual, derived classes can easily provide a variety of output formats to an
ostream
. This is a more flexible form of object I/O than the
file descriptor
object I/O provided by classes
OIOofd
and
OIOifd
, but is less efficient.
OIOostream(ostream&
s, unsigned
capacity
=256)
OIOostream
for the
ostream
s
with an initial object capacity of
capacity
objects (see class
StoreOnTbl
).
virtual OIOostream& operator<<(const char*)
ostream
associated with this
OIOostream
via
ostream::operator<<(const char*)
and returns a reference to this
OIOostream
.
virtual OIOostream& operator<<(char)
virtual OIOostream& operator<<(unsigned char)
virtual OIOostream& operator<<(short)
virtual OIOostream& operator<<(unsigned short)
virtual OIOostream& operator<<(int)
virtual OIOostream& operator<<(unsigned int)
virtual OIOostream& operator<<(long)
virtual OIOostream& operator<<(unsigned long)
virtual OIOostream& operator<<(float)
virtual OIOostream& operator<<(double)
ostream
associated with this
OIOostream
via
ostream::operator<<()
and returns a reference to this
OIOostream
.
virtual OIOostream& put(char
val)
ostream
associated with this
OIOostream
via
ostream::put(char)
and returns a reference to this
OIOostream
.
virtual OIOostream& put(const char*
val, unsigned
size)
virtual OIOostream& put(const unsigned char*
val, unsigned
size)
ostream
associated with this
OIOostream
via
ostream::operator<<(int)
and returns a reference to this
OIOostream
.
virtual OIOostream& put(const short*
val, unsigned
size)
virtual OIOostream& put(const unsigned short*
val, unsigned
size)
virtual OIOostream& put(const int*
val, unsigned
size)
virtual OIOostream& put(const unsigned int*
val, unsigned
size)
virtual OIOostream& put(const long*
val, unsigned
size)
virtual OIOostream& put(const unsigned long*
val, unsigned
size)
virtual OIOostream& put(const float*
val, unsigned
size)
virtual OIOostream& put(const double*
val, unsigned
size)
ostream
associated with this
OIOostream
via
ostream::operator<<()
and returns a reference to this
OIOostream
.
virtual OIOostream& putCString(const char*
s)
ostream
associated with this
OIOostream
and returns a reference to this
OIOostream
.
virtual int precision(int
n)
virtual int precision()
virtual int width(int
n)
virtual int width()
operator ostream&()
ostream
associated with this
OIOostream
.
ostream* strm; // output stream unsigned col; // current column static const unsigned MAXCOL; // max columns in output line
void putwrap(char
c)
void putwrap(unsigned char
c)
col
and writes a newline and resets
col
to 1 if
col
exceeds
MAXCOL
. Writes the character
c
to the
ostream* strm
.
void putwrap(const char*
s, unsigned
len)
col
and writes a newline and resets
col
to
len
if
col
exceeds
MAXCOL
. Writes the character string
s
to the
ostream* strm
.
virtual void storeObject(const Object&
ob) = 0
ostream
associated with this
OIOostream
. Decides whether to store the object's class description or a reference to a previous class description. Decides whether to store the object itself, or a reference to a previously stored object.
Go to the previous, next section.