diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-E79D47D6-3FF2-5858-B092-29D39A1CA2B6.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-E79D47D6-3FF2-5858-B092-29D39A1CA2B6.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,25 @@ + + + + + +How to commit streams

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().

\ No newline at end of file