Rogue Wave Views
Application Framework Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvDvStream Class Reference

Application Framework stream base class. More...

#include <ilviews/appframe/stream.h>

Inheritance diagram for IlvDvStream:
IlvDvFileStream

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...
 
IlvDvStreamoperator<< (IlInt i)
 Writes the integer i. More...
 
IlvDvStreamoperator<< (IlUShort w)
 Writes the unsigned short integer w. More...
 
IlvDvStreamoperator<< (IlShort ch)
 Writes the short integer ch. More...
 
IlvDvStreamoperator<< (IlUInt u)
 Writes the unsigned integer u. More...
 
IlvDvStreamoperator<< (IlBoolean b)
 Writes the Boolean value b. More...
 
IlvDvStreamoperator<< (IlFloat f)
 Writes the float value f. More...
 
IlvDvStreamoperator<< (IlDouble d)
 Writes the double value d. More...
 
IlvDvStreamoperator<< (const IlvString &s)
 Writes the string s. More...
 
IlvDvStreamoperator>> (IlInt &i)
 Reads an integer value and stores it in the i parameter. More...
 
IlvDvStreamoperator>> (IlUShort &w)
 Reads an unsigned short integer value and stores it in the w parameter. More...
 
IlvDvStreamoperator>> (IlShort &ch)
 Reads a short integer value and stores it in the ch parameter. More...
 
IlvDvStreamoperator>> (IlUInt &u)
 Reads an unsigned integer value and stores it in the u parameter. More...
 
IlvDvStreamoperator>> (IlBoolean &b)
 Reads a Boolean value and stores it in the b parameter. More...
 
IlvDvStreamoperator>> (IlFloat &f)
 Reads a float value and stores it in the f parameter. More...
 
IlvDvStreamoperator>> (IlDouble &d)
 Reads a double value and stores it in the d parameter. More...
 
IlvDvStreamoperator>> (IlvString &s)
 Reads a string and stores it in the string object s parameter. More...
 
IlvDvSerializablereadObject ()
 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...
 

Detailed Description

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.

Member Function Documentation

istream* IlvDvStream::getInStream ( ) const

Verbose:

Returns the internal input stream. If isSaving() returns IlTrue, it returns 0.

Returns
The internal input stream.
ostream* IlvDvStream::getOutStream ( ) const

Returns the internal output stream.

If isSaving() returns IlFalse, it returns 0.

Returns
The internal output stream.
IlBoolean IlvDvStream::isSaving ( ) const

Returns IlTrue if the stream is used for saving data.

Returns
IlTrue if the stream is used for saving data.
IlvDvStream& IlvDvStream::operator<< ( IlInt  i)

Writes the integer i.

Returns
The stream.
IlvDvStream& IlvDvStream::operator<< ( IlUShort  w)

Writes the unsigned short integer w.

Returns
The stream.
IlvDvStream& IlvDvStream::operator<< ( IlShort  ch)

Writes the short integer ch.

Returns
The stream.
IlvDvStream& IlvDvStream::operator<< ( IlUInt  u)

Writes the unsigned integer u.

Returns
The stream.
IlvDvStream& IlvDvStream::operator<< ( IlBoolean  b)

Writes the Boolean value b.

Returns
The stream.
IlvDvStream& IlvDvStream::operator<< ( IlFloat  f)

Writes the float value f.

Returns
The stream.
IlvDvStream& IlvDvStream::operator<< ( IlDouble  d)

Writes the double value d.

Returns
The stream.
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).

Returns
The stream.
IlvDvStream& IlvDvStream::operator>> ( IlInt i)

Reads an integer value and stores it in the i parameter.

Returns
The stream.
IlvDvStream& IlvDvStream::operator>> ( IlUShort w)

Reads an unsigned short integer value and stores it in the w parameter.

Returns
The stream.
IlvDvStream& IlvDvStream::operator>> ( IlShort ch)

Reads a short integer value and stores it in the ch parameter.

Returns
The stream.
IlvDvStream& IlvDvStream::operator>> ( IlUInt u)

Reads an unsigned integer value and stores it in the u parameter.

Returns
The stream.
IlvDvStream& IlvDvStream::operator>> ( IlBoolean b)

Reads a Boolean value and stores it in the b parameter.

Returns
The stream.
IlvDvStream& IlvDvStream::operator>> ( IlFloat f)

Reads a float value and stores it in the f parameter.

Returns
The stream.
IlvDvStream& IlvDvStream::operator>> ( IlDouble d)

Reads a double value and stores it in the d parameter.

Returns
The stream.
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.

Returns
The stream.
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.

Returns
The new loaded object.
See also
IlvDvSerializable
void IlvDvStream::serialize ( IlvString &  s,
IlBoolean  betweenQuotes = IlTrue 
)

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.

Parameters
sThe string to serialize.
betweenQuotesIf IlTrue, the string is saved between quotes, so that it can contain blank spaces.
void IlvDvStream::serialize ( const IlSymbol *&  s,
IlBoolean  betweenQuotes = IlTrue 
)

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.

Parameters
sThe symbol to serialize.
betweenQuotesIf IlTrue, the string of the symbol is saved between quotes, and can therefore contain blank spaces.
void IlvDvStream::serializeBitmap ( IlvBitmap *&  b,
IlBoolean  lock = IlTrue 
)

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.

Parameters
bThe bitmap to serialize.
lockIf IlTrue, the loaded bitmap is locked.
void IlvDvStream::serializeObjects ( IlvArray &  objs)

Serializes the array objs of IlvDvSerializable objects given as the parameter.

Parameters
objsArray 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.

Parameters
oObject to write.
See also
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.