Go to the previous, next section.
#include <nihcl/OIOfd.h>
Class
OIOofd
implements object output for the
storeOn()
function to UNIX file descriptors via the
write()
system call. It provides member functions for writing the fundamental data types, arrays of fundamental data types, and C-style (null-terminated) character strings.
This
file descriptor
object output is more efficient than the
stream
object output that class
OIOout
provides because these are non-virtual, inline member functions that call
write()
directly, and do no formatting. Thus, the object output format produced by
OIOofd
is machine dependent.
OIOofd(int
filedesc, unsigned
capacity
=256)
OIOofd
for the UNIX file descriptor
filedesc
with an initial object capacity of
capacity
objects (see class
StoreOnTbl
).
OIOofd& operator<<(const char*)
OIOofd
via the UNIX
write()
function. Raises an
NIHCL_STOREBINERR
exception if the call to
write()
fails. Returns a reference to this
OIOofd
if successful.
OIOofd& operator<<(char)
OIOofd& operator<<(unsigned char)
OIOofd& operator<<(short)
OIOofd& operator<<(unsigned short)
OIOofd& operator<<(int)
OIOofd& operator<<(unsigned int)
OIOofd& operator<<(long)
OIOofd& operator<<(unsigned long)
OIOofd& operator<<(float)
OIOofd& operator<<(double)
OIOofd
via the UNIX
write()
system call. The
sizeof
operator is used to determine the number of bytes to write. Raises an
NIHCL_STOREBINERR
exception if the call to
write()
fails. Returns a reference to this
OIOofd
if successful.
OIOofd& put(const char*
val, unsigned
size)
OIOofd& put(const unsigned char*
val, unsigned
size)
OIOofd& put(const short*
val, unsigned
size)
OIOofd& put(const unsigned short*
val, unsigned
size)
OIOofd& put(const int*
val, unsigned
size)
OIOofd& put(const unsigned int*
val, unsigned
size)
OIOofd& put(const long*
val, unsigned
size)
OIOofd& put(const unsigned long*
val, unsigned
size)
OIOofd& put(const float*
val, unsigned
size)
OIOofd& put(const double*
val, unsigned
size)
OIOofd
via the UNIX
write()
system call. The
sizeof
operator is used to determine the array element size. Raises an
NIHCL_STOREBINERR
exception if the call to
write()
fails. Returns a reference to this
OIOofd
if successful.
OIOofd& putCString(const char*
s)
OIOofd
via the UNIX
write()
function. Raises an
NIHCL_STOREBINERR
exception if the call to
write()
fails. Returns a reference to this
OIOofd
if successful.
OIOofd& write(const char*
buf, unsigned
n)
OIOofd
via the UNIX
write()
system call. Raises an
NIHCL_STOREBINERR
exception if the call to
write()
fails. Returns a reference to this
OIOofd
if successful.
operator int()
OIOofd
.
virtual void storeObject(const Object&
ob)
storeOn()
operation on this
OIOofd
. Otherwise, writes a reference to the class of
ob
if an object of the same class has already been written by the current
storeOn()
operation on this
OIOofd
, or writes the class name and signature if it has not been previously written. Writes
ob
by applying
storer()
.
NIHCL_STOREBINERR
Go to the previous, next section.