Rogue Wave Views Application Framework Package API Reference Guide |
Rogue Wave Views Documentation Home |
Application Framework stream base class. More...
#include <ilviews/appframe/stream.h>
Public Member Functions | |
istream * | getInStream () const |
Verbose: More... | |
ostream * | getOutStream () const |
Returns the internal output stream. More... | |
IlBoolean | isSaving () const |
Returns IlTrue if the stream is used for saving data. More... | |
IlvDvStream & | operator<< (IlInt i) |
Writes the integer i. More... | |
IlvDvStream & | operator<< (IlUShort w) |
Writes the unsigned short integer w. More... | |
IlvDvStream & | operator<< (IlShort ch) |
Writes the short integer ch. More... | |
IlvDvStream & | operator<< (IlUInt u) |
Writes the unsigned integer u. More... | |
IlvDvStream & | operator<< (IlBoolean b) |
Writes the Boolean value b. More... | |
IlvDvStream & | operator<< (IlFloat f) |
Writes the float value f. More... | |
IlvDvStream & | operator<< (IlDouble d) |
Writes the double value d. More... | |
IlvDvStream & | operator<< (const IlvString &s) |
Writes the string s. More... | |
IlvDvStream & | operator>> (IlInt &i) |
Reads an integer value and stores it in the i parameter. More... | |
IlvDvStream & | operator>> (IlUShort &w) |
Reads an unsigned short integer value and stores it in the w parameter. More... | |
IlvDvStream & | operator>> (IlShort &ch) |
Reads a short integer value and stores it in the ch parameter. More... | |
IlvDvStream & | operator>> (IlUInt &u) |
Reads an unsigned integer value and stores it in the u parameter. More... | |
IlvDvStream & | operator>> (IlBoolean &b) |
Reads a Boolean value and stores it in the b parameter. More... | |
IlvDvStream & | operator>> (IlFloat &f) |
Reads a float value and stores it in the f parameter. More... | |
IlvDvStream & | operator>> (IlDouble &d) |
Reads a double value and stores it in the d parameter. More... | |
IlvDvStream & | operator>> (IlvString &s) |
Reads a string and stores it in the string object s parameter. More... | |
IlvDvSerializable * | readObject () |
Reads an IlvDvSerializable object. More... | |
void | serialize (IlvString &s, IlBoolean betweenQuotes=IlTrue) |
Serializes the string parameter s. More... | |
void | serialize (const IlSymbol *&s, IlBoolean betweenQuotes=IlTrue) |
Serializes the symbol parameter s. More... | |
void | serializeBitmap (IlvBitmap *&b, IlBoolean lock=IlTrue) |
Serializes the bitmap parameter b. More... | |
void | serializeObjects (IlvArray &objs) |
Serializes the array objs of IlvDvSerializable objects given as the parameter. More... | |
void | writeObject (const IlvDvSerializable *o) |
Writes an IlvDvSerializable object. More... | |
Application Framework stream base class.
Library: ilvappframe
IlvDvStream
is the base class of the stream class hierarchy.
It is used in the Application Framework library to make serialization of objects (reading and saving data of objects) easier.
In particular, an IlvDvStream
object is given as the parameter of the serialize
method of the IlvDvDocument
class. Documents use this class to read and write their data.
It encapsulates an istream
or an ostream
object, given by methods getInStream()
to read data, and getOutStream()
to write data. Method isSaving()
indicates whether the stream is used for reading or writing.
IlvDvStream
provides operators and methods that make it easier and safer to read and write data. Operators let you read and write basic data types without considering blank spaces. Other methods serialize strings, objects, or arrays of objects in a safe and easy way.
istream* IlvDvStream::getInStream | ( | ) | const |
Verbose:
Returns the internal input stream. If isSaving()
returns IlTrue
, it returns 0.
ostream* IlvDvStream::getOutStream | ( | ) | const |
Returns the internal output stream.
If isSaving()
returns IlFalse
, it returns 0.
IlBoolean IlvDvStream::isSaving | ( | ) | const |
Returns IlTrue
if the stream is used for saving data.
IlTrue
if the stream is used for saving data. IlvDvStream& IlvDvStream::operator<< | ( | IlInt | i | ) |
Writes the integer i.
IlvDvStream& IlvDvStream::operator<< | ( | IlUShort | w | ) |
Writes the unsigned short integer w.
IlvDvStream& IlvDvStream::operator<< | ( | IlShort | ch | ) |
Writes the short integer ch.
IlvDvStream& IlvDvStream::operator<< | ( | IlUInt | u | ) |
Writes the unsigned integer u.
IlvDvStream& IlvDvStream::operator<< | ( | IlBoolean | b | ) |
Writes the Boolean value b.
IlvDvStream& IlvDvStream::operator<< | ( | IlFloat | f | ) |
Writes the float value f.
IlvDvStream& IlvDvStream::operator<< | ( | IlDouble | d | ) |
Writes the double value d.
IlvDvStream& IlvDvStream::operator<< | ( | const IlvString & | s | ) |
Writes the string s.
The string must not contain any blank spaces. If it does, call method serialize(s, IlTrue)
.
IlvDvStream& IlvDvStream::operator>> | ( | IlInt & | i | ) |
Reads an integer value and stores it in the i parameter.
IlvDvStream& IlvDvStream::operator>> | ( | IlUShort & | w | ) |
Reads an unsigned short integer value and stores it in the w parameter.
IlvDvStream& IlvDvStream::operator>> | ( | IlShort & | ch | ) |
Reads a short integer value and stores it in the ch parameter.
IlvDvStream& IlvDvStream::operator>> | ( | IlUInt & | u | ) |
Reads an unsigned integer value and stores it in the u parameter.
IlvDvStream& IlvDvStream::operator>> | ( | IlBoolean & | b | ) |
Reads a Boolean value and stores it in the b parameter.
IlvDvStream& IlvDvStream::operator>> | ( | IlFloat & | f | ) |
Reads a float value and stores it in the f parameter.
IlvDvStream& IlvDvStream::operator>> | ( | IlDouble & | d | ) |
Reads a double value and stores it in the d parameter.
IlvDvStream& IlvDvStream::operator>> | ( | IlvString & | s | ) |
Reads a string and stores it in the string object s parameter.
The read string must not contain any blank spaces. If it does, method serialize(IlvString&, IlTrue)
must be used.
IlvDvSerializable* IlvDvStream::readObject | ( | ) |
Reads an IlvDvSerializable
object.
Reads an object from the input stream. First, the class name of the object is read. Then an object of the corresponding class is automatically created using the class information. To do this, object classes must be declared and implemented using macros IlvDvDeclareDynCreate()
, IlvDvPreRegisterDynClass(<classname>, <superClassname>)
, and IlvDvPostRegisterDynClass(<classname>, <superClassname>)
.
Finally, the data of the new object is loaded by calling method serialize
of the object.
IlvDvSerializable
Serializes the string parameter s.
Depending on the serialization mode, it saves the string given as the parameter or it reads a string value and stores it in the given string parameter.
s | The string to serialize. |
betweenQuotes | If IlTrue , the string is saved between quotes, so that it can contain blank spaces. |
Serializes the symbol parameter s.
Depending on the serialization mode, it either saves the string of the symbol given as the parameter or it reads a string value that is converted into a symbol and set to the given symbol parameter.
s | The symbol to serialize. |
betweenQuotes | If IlTrue , the string of the symbol is saved between quotes, and can therefore contain blank spaces. |
Serializes the bitmap parameter b.
Depending on the serialization mode, it either saves the path of the bitmap given as the parameter or it reads the path of the bitmap that is loaded and set to the given bitmap parameter.
b | The bitmap to serialize. |
lock | If IlTrue , the loaded bitmap is locked. |
void IlvDvStream::serializeObjects | ( | IlvArray & | objs | ) |
Serializes the array objs of IlvDvSerializable
objects given as the parameter.
objs | Array of objects to serialize. |
void IlvDvStream::writeObject | ( | const IlvDvSerializable * | o | ) |
Writes an IlvDvSerializable
object.
Writes the object o that is given as the parameter. First, the class name of the object is saved. Then its data is saved by calling its method serialize
.
o | Object to write. |
IlvDvSerializable
© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.