Location:
s32strm.h
Link against: estor.lib
RWriteStream
Supported from 5.0
The write stream interface. The process of externalising to a stream is achieved through a reference to an object of this type.
A store aware class defines and implements an
ExternalizeL()
member function which is used to externalise that
object and takes a reference to an RWriteStream
as the interface
to the write stream.
Defined in RWriteStream
:
Attach()
, Close()
, CommitL()
, Detach()
, Pop()
, PushL()
, RWriteStream()
, Release()
, Sink()
, WriteInt16L()
, WriteInt32L()
, WriteInt8L()
, WriteL()
, WriteReal32L()
, WriteReal64L()
, WriteUint16L()
, WriteUint32L()
, WriteUint8L()
RWriteStream();
The stream buffer sink, as returned by Sink()
, is
set to NULL, and the stream has no associated Store map.
RWriteStream(const MExternalizer<TStreamRef>& anExter);
Constructs a write stream with an associated store map. The stream buffer sink is set to NULL.
|
RWriteStream(MStreamBuf* aSink);
Constructs a write stream over the supplied stream buffer. The stream has no associated Store map.
|
void WriteL(const TDesC8& aDes);
Writes the content of the 8 bit descriptor to the stream. No other information is written to this write stream.
|
void WriteL(const TDesC16& aDes);
Writes the content of the 16 bit descriptor to the stream. No other information is written to this write stream.
|
void WriteL(const TDesC8& aDes,TInt aLength);
Writes data of the specified length from the 8 bit descriptor to the stream. No other information is written to this write stream.
|
void WriteL(const TDesC16& aDes,TInt aLength);
Writes data of the specified length from the 16 bit descriptor to the stream. No other information is written to this write stream.
|
void WriteL(const TUint8* aPtr,TInt aLength);
Writes 8 bit data of the specified length from the specified location to this write stream.
|
void WriteL(const TUint16* aPtr,TInt aLength);
Writes 16 bit data of the specified length from the specified location to this write stream.
|
void WriteL(RReadStream& aStream);
Writes the content of the specified read stream to this write stream.
|
void WriteL(RReadStream& aStream,TInt aLength);
Writes data of the specified length from the specified read stream to this stream.
|
void WriteInt8L(TInt aValue);
Writes a TInt
value as an 8 bit value to this
stream.
|
void WriteInt16L(TInt aValue);
Writes a TInt
value as a 16 bit value to this
stream.
|
void WriteInt32L(TInt32 aValue);
Writes a TInt32
value as a 32 bit value to this
stream.
|
void WriteUint8L(TUint aValue);
Writes a TUint
value as an 8 bit value to this
stream.
|
void WriteUint16L(TUint aValue);
Writes a TUint
value as a 16 bit value to this
stream.
|
void WriteUint32L(TUint32 aValue);
Writes a TUint32
value as a 32 bit value to this
stream.
|
void WriteReal32L(TReal aValue);
Writes a TReal
value as a 32 bit value to this
stream.
|
void WriteReal64L(TReal64 aValue);
Writes a TReal64
value as a 64 bit value to this
stream.
|
void Release();
Frees resources before abandoning the stream. The function is called after data has been committed to the stream.
Note that if a cleanup item for the stream was placed on the cleanup
stack when the stream was opened (e.g by a call to
RStoreWriteStreams
’s CreateLC()
,
OpenLC()
, ReplaceLC()
or
RDictionaryStore
’s AssignLC()
etc), then this
function need not be called explicitly; clean up is implicitly done by
CleanupStack::PopAndDestroy()
.
void Close();
Commits data to the stream before freeing resources used by the stream. This ensures that any buffered data is written to the stream.
Note that the function cannot leave. Any errors arising from the attempt to commit data to the stream are ignored.
void CommitL();
Ensures that any buffered data is written to the stream. Once committed, it is not possible to roll back the newly written data.
void Pop();
Removes the cleanup item for this write stream object from the cleanup stack.
void PushL();
Puts a cleanup item for this write stream object onto the cleanup stack. This allows allocated resources to be cleaned up if a subsequent leave occurs.
protected: void Attach(MStreamBuf* aSink);
Sets the stream buffer sink for this write stream. The existing sink, if there is one, will be discarded.
This is useful for derived classes, enabling them to set the sink following construction.
Note:
Release()
is not called for discarded sinks.
|
protected: void Detach();
Sets the stream buffer sink for this write stream to NULL. The existing sink, if there is one, will be discarded.
Note:
Release()
is not called for discarded sinks.
MStreamBuf* Sink();
Gets the underlying stream buffer for the write stream. This provides access to the stream-buffer implementation used by the write stream.
|