example

Streaming Example

Compilable code example of using the Symbian Streaming API. Demonstrates how to store the whole object with the boolean, integer and descriptor data fields to and from stream.


// Let the data format be:
//
//
// Note, that when dealing with packaged data, we have to be careful about
// the concrete size in bytes. Descriptors will be saved using Symbian
// default format for descriptors. For TBool we use the default conversion
// to TInt
void CEmployee::ExternalizeL( RWriteStream &aStream ) const
{
// Write the used protocol version first
aStream << KEmployeeProtocolVersion;
aStream << static_cast ( iAge );
aStream << static_cast ( iFired );
aStream << static_cast ( iName->Length() );
aStream << *iName;
aStream << static_cast ( iSurname->Length() );
aStream << *iSurname;
}

Symbian code examples by Mika Raento

A huge amount of Symbian code examples by Mika Raento. All licenced under GPL and MIT. For example Receiving SMS, Profile API and even Debug call stack.

Note, that these code examples are not completely standalone, but are a part of a big Context research project and for the most of examples you'll have to download some extra files.

Syndicate content