For a class TX defined as:
class TX
{
public:
...
void ExternalizeL(RWriteStream& aStream) const;
void InternalizeL(RReadStream& aStream);
...
};
an instance of TX can be externalised to the stream outstream , by calling the ExternalizeL() member function of TX :
...
TX object;
...
object.ExternalizeL(outstream);
...
An alternative, and better way, is to use the templated stream operator<< . The Store framework implements this by calling TX::ExternalizeL() . The syntax is simply:
...
outstream << object; // externalise object
...
Similarly, the TX object can be internalised from the stream instream , by calling the InternalizeL() member function of TX :
TX object;
...
object.InternalizeL(instream);
...
The templated stream operator>> can also be used. The Store framework implements this by calling TX::InternalizeL() . The syntax is simply:
instream >> object; // internalise object
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.