diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-DA4160B0-7B63-5C84-B3C6-190100530EDE.dita --- a/Symbian3/PDK/Source/GUID-DA4160B0-7B63-5C84-B3C6-190100530EDE.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-DA4160B0-7B63-5C84-B3C6-190100530EDE.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,40 +1,40 @@ - - - - - -How to use templated stream operators

Templated stream operators are straight forward to use. For example, given the class TSimple defined as:

class TSimple - { - public : - void InternalizeL(RReadStream& aStream); - void ExternalizeL(RWriteStream& aStream) const; - ... - TInt8 iInt8Value; - TInt64 iInt64Value; - TRect iRectangle; - TUid iUid; - CBufSeg* iSegBuffer; - }

ExternalizeL() and InternalizeL() might be implemented as:

void TSimple::ExternalizeL(RWriteStream& aStream) const - { - aStream << iInt8Value; - aStream << iInt64Value; - aStream << iRectangle - aStream << iUid; - aStream << *iSegBuffer; - } void TSimple::InternalizeL(RReadStream& aStream) - { - aStream >> iInt8Value; - aStream >> iInt64Value; - aStream >> iRectangle - aStream >> iUid; - aStream >> *iSegBuffer; - }

The templated operators can also be used on an object of type TSimple. For example:

TSimple simple; -... -aStream << simple; + + + + + +How to use templated stream operators

Templated stream operators are straight forward to use. For example, given the class TSimple defined as:

class TSimple + { + public : + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + ... + TInt8 iInt8Value; + TInt64 iInt64Value; + TRect iRectangle; + TUid iUid; + CBufSeg* iSegBuffer; + }

ExternalizeL() and InternalizeL() might be implemented as:

void TSimple::ExternalizeL(RWriteStream& aStream) const + { + aStream << iInt8Value; + aStream << iInt64Value; + aStream << iRectangle + aStream << iUid; + aStream << *iSegBuffer; + } void TSimple::InternalizeL(RReadStream& aStream) + { + aStream >> iInt8Value; + aStream >> iInt64Value; + aStream >> iRectangle + aStream >> iUid; + aStream >> *iSegBuffer; + }

The templated operators can also be used on an object of type TSimple. For example:

TSimple simple; +... +aStream << simple; ...

The operator<< results in call to TSimple::ExternalizeL() function and this, in turn, calls operator<< on TSimple's data members.

\ No newline at end of file