Once data has been externalised to a stream, an application must commit a stream before disposing of the write stream object.
This is done by calling CommitL() on the write stream object. The function itself is a member of the write stream interface class, RWriteStream .
The following example code fragment shows this:
...
TSimple thesimple;
...
... // Construct a TSimple object
...
RStoreWriteStream outstream;
TStreamId id = outstream.CreateLC(*store);
// Externalize the TSimple object
outstream << thesimple;
// Commit changes to the stream
outstream.CommitL();
// Cleanup the stream object
CleanupStack::PopAndDestroy();
...
store is a pointer to an already opened stream store.
As a simple rule, CreateL() or CreateLC() is matched by a call to CommitL() . More generally, any change to a stream, either the creation of a new one or a change to an existing one, should be matched by a call to CommitL() .
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.