Go to the previous, next section.
#include <nihcl/OIOnih.h>
Class
OIOnihin
implements a simple "NIH format" object input from
istream
s for the
readFrom()
function. It inherits virtual member functions for reading the fundamental data types, arrays of fundamental data types, and C-style (null-terminated) character strings. It also inherits virtual member functions for setting and accessing the input format precision and field width. It defines a
readObject()
member function to interpret the object format written by
OIOnihout::storeObject()
.
OIOnihin(istream&
s, unsigned
capacity
=1024)
OIOnihin
for the
istream
s
with an initial object capacity of
capacity
objects (see class
ReadFromTbl
).
virtual Object* readObject(const Class&
expect)
OIOnihout::storeObject()
from the
istream
associated with this
OIOnihin
.
Raises an
NIHCL_RDUNKCLASS
exception if the class descriptor of the object to be read has not been linked with the program.
Raises an
NIHCL_RDWRONGCLASS
exception if the class of the object read is not an instance of class
expected
or an instance of a derived class of
expected.
Raises an
NIHCL_RDBADSIG
exception if the signature of the class of the object read does not match the signature of the class descriptor of the same name that has been linked with the program. This is to detect an attempt to read an object stored by an outdated version of the class.
Returns a pointer to the object read if successful.
NIHCL_RDEOF
,
NIHCL_RDFAIL
,
NIHCL_RDSYNERR
,
NIHCL_RDWRONGCLASS
,
NIHCL_RDUNKCLASS
,
NIHCL_RDBADSIG
Go to the previous, next section.