Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: s32strm.h
Link against: estor.lib

Class RReadStream

RReadStream

Support

Supported from 5.0

Description

The read stream interface. The process of internalising from a stream is achieved through a reference to an object of this type.

A store aware class defines an implements an InternalizeL() member function which is used to internalise that object and takes a reference to an RReadStream as the interface to the read stream.

Defined in RReadStream:
Attach(), Close(), Detach(), Pop(), PushL(), RReadStream(), ReadInt16L(), ReadInt32L(), ReadInt8L(), ReadL(), ReadReal32L(), ReadReal64L(), ReadUint16L(), ReadUint32L(), ReadUint8L(), Release(), Source()


Construction and destruction


RReadStream()

RReadStream();

Description

Sets the stream buffer source to NULL, which implies that it is safe to close

See also:


RReadStream()

RReadStream(MStreamBuf* aSource);

Description

Constructs a read stream over the supplied stream buffer.

Parameters

MStreamBuf* aSource

The stream buffer used to read from the read stream.

See also:

[Top]


Internalising


ReadL()

void ReadL(TDes8& aDes);

Description

Reads sufficient data from this stream to fill the specified 8 bit descriptor up to its maximum length. No other information is read from this read stream.

Parameters

TDes8& aDes

A reference to a modifiable descriptor which is to receive the data read from this stream. Passing the build independent type TDes& allows the compiler to choose the appropriate ReadL() variant (i.e the 8 bit or the 16 bit) at build time.

Leave codes

 

If the length of data available in the stream is less than the maximum length of aDes , then the function leaves with KErrEof .


ReadL()

void ReadL(TDes16& aDes);

Description

Reads sufficient data from this stream to fill the specified 16 bit descriptor up to its maximum length. No other information is read from this read stream.

Parameters

TDes16& aDes

A reference to a modifiable type descriptor which is to receive the data read from this stream. Passing the build independent type TDes& allows the compiler to choose the appropriate ReadL() variant (i.e the 8 bit or the 16 bit) at build time.

Leave codes

 

If the length of data available in the stream is less than the maximum length of aDes , then the function leaves with KErrEof .


ReadL()

void ReadL(TDes8& aDes,TInt aLength);

Description

Reads data of specified length from this stream into the specified 8 bit descriptor. No other information is read from this stream.

Parameters

TDes8& aDes

A reference to a modifiable type descriptor which is to receive the data read from this stream. Passing the build independent type TDes& allows the compiler to choose the appropriate ReadL() variant (i.e the 8 bit or the 16 bit) at build time.

TInt aLength

The length of data to be read from this stream. This value must be non-negative and must not be greater than the maximum length of the descriptor otherwise the function raises a USER 23 panic.

Leave codes

 

If the length of data available in the stream is less than aLength , then the function leaves with KErrEof .


ReadL()

void ReadL(TDes16& aDes,TInt aLength);

Description

Reads data of specified length from this stream into the specified 16 bit descriptor. No other information is read from this stream.

Parameters

TDes16& aDes

A reference to a modifiable type descriptor which is to receive the data read from this stream. Passing the build independent type TDes& allows the compiler to choose the appropriate ReadL() variant (i.e the 8 bit or the 16 bit) at build time.

TInt aLength

The length of data to be read from this stream. This value must be non-negative and must not be greater than the maximum length of the descriptor otherwise the function raises a USER 11 panic.

Leave codes

 

If the length of data available in the stream is less than aLength , then the function leaves with KErrEof .


ReadL()

void ReadL(TDes8& aDes,TChar aDelim);

Description

Reads data from this stream into the 8 bit descriptor, until either the specified delimiter is encountered or the descriptor is filled to its maximum length.

The resulting data in aDes always includes the delimiter aDelim, if aDes is large enough.

Parameters

TDes8& aDes

A reference to a modifiable type descriptor which is to receive the data read from this stream. Passing the build independent type TDes& allows the compiler to choose the appropriate ReadL() variant (i.e the 8 bit or the 16 bit) at build time.

TChar aDelim

The delimiter marking the end of the data in the stream.

Leave codes

 

The function leaves with KErrEof , if the stream is exhausted before a delimiter is found.


ReadL()

void ReadL(TDes16& aDes,TChar aDelim);

Description

Reads data from this stream into the 16 bit descriptor, until either the specified delimiter is encountered or the descriptor is filled to its maximum length.

The resulting data in aDes always includes the delimiter aDelim, if aDes is large enough.

Parameters

TDes16& aDes

A reference to a modifiable type descriptor which is to receive the data read from this stream. Passing the build independent type TDes& allows the compiler to choose the appropriate ReadL() variant (i.e the 8 bit or the 16 bit) at build time.

TChar aDelim

The delimiter marking the end of the data in the stream.

Leave codes

 

The function leaves with KErrEof , if the stream is exhausted before a delimiter is found.


ReadL()

void ReadL(TUint8* aPtr,TInt aLength);

Description

Reads data of specified length from this stream into the location defined by the specified TUint8 pointer.

Parameters

TUint8* aPtr

The target location for the streamed in data.

TInt aLength

The length of data to be streamed in.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .


ReadL()

void ReadL(TUint16* aPtr,TInt aLength);

Description

Reads data of specified length from this stream into the location defined by the specified TUint16 pointer.

Parameters

TUint16* aPtr

The target location for the streamed in data.

TInt aLength

The length of data to be streamed in.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .


ReadL()

void ReadL(RWriteStream& aStream);

Description

Writes the content of this stream to the specified write stream.

Parameters

RWriteStream& aStream

A reference to the write stream to which this stream is to be written.


ReadL()

void ReadL(RWriteStream& aStream,TInt aLength);

Description

Writes a specified length of the content of this stream to the specified write stream.

Parameters

RWriteStream& aStream

A reference to the write stream to which this stream is to be written.

TInt aLength

The length of data from this stream to be written to aStream.


ReadL()

void ReadL(TInt aLength);

Description

Discards data of specified length read from this stream.

Parameters

TInt aLength

The length of data to be discarded from this read stream.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .


ReadInt8L()

TInt8 ReadInt8L();

Description

Internalises a TInt8 value The function reads an 8 bit value from this stream and interprets it as a TInt8.

Return value

TInt8

The 8 bit value read from this stream.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .


ReadInt16L()

TInt16 ReadInt16L();

Description

Internalises a TInt16 value. The function reads a 16 bit value from this stream and interprets it as a TInt16.

Return value

TInt16

The 16 bit value read from this stream.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .


ReadInt32L()

TInt32 ReadInt32L();

Description

Internalises a TInt32 value. The function reads a 32 bit value from this stream and interprets it as a TInt32.

Return value

TInt32

The 32 bit value read from this stream.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .


ReadUint8L()

TUint8 ReadUint8L();

Description

Internalises a TUint8 value. The function reads an 8 bit value from this stream and interprets it as a TUint8.

Return value

TUint8

The 8 bit value read from this stream.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .


ReadUint16L()

TUint16 ReadUint16L();

Description

Internalises a TUint16 value. The function reads a 16 bit value from this stream and interprets it as a TUint16.

Return value

TUint16

The 16 bit value read from this stream.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .


ReadUint32L()

TUint32 ReadUint32L();

Description

Internalises a TUint32 value. The function reads a 32 bit value from this stream and interprets it as a TUint32.

Return value

TUint32

The 32 bit value read from this stream.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .


ReadReal32L()

TReal32 ReadReal32L();

Description

Internalises a TReal32 value. The function reads a 32 bit value from this stream and interprets it as a TReal32.

Return value

TReal32

The 32 bit value read from this read stream.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .


ReadReal64L()

TReal64 ReadReal64L();

Description

Internalises a TReal64 value. The function reads a 64 bit value from this stream and interprets it as a TReal64.

Return value

TReal64

The 64 bit value read from this stream.

Leave codes

 

If the length of data available in the stream is less than the length of data requested, then the function leaves with KErrEof .

[Top]


Cleanup support


PushL()

void PushL();

Description

Puts a cleanup item for this read stream object onto the cleanup stack. This allows allocated resources to be cleaned up if a subsequent leave occurs.


Pop()

void Pop();

Description

Removes the cleanup item for this read stream object from the cleanup stack.

[Top]


Releasing resources


Release()

void Release();

Description

Frees resources before abandoning the stream.

Note that, if a cleanup item for the stream was placed on the cleanup stack when the stream was opened by a call to OpenLC(), then this function need not be called explicitly; clean up is implicitly done by CleanupStack::PopAndDestroy().


Close()

void Close();

Description

Frees resources used by the stream.

See also:

[Top]


Attaching & Detaching stream buffers


Attach()

protected: void Attach(MStreamBuf* aSource);

Description

Sets the stream buffer source for this read stream. The existing source (if there is one) will be discarded.

This is useful for derived classes, enabling them to set the source following construction.

Note:

Parameters

MStreamBuf* aSource

The new source stream buffer for this read stream.

See also:


Detach()

protected: void Detach();

Description

Sets the stream buffer source for this read stream to NULL. The existing source, if there is one, will be discarded.

Note that Release() is not called on any discarded stream buffer.

See also:


Source()

MStreamBuf* Source();

Description

Gets the underlying stream buffer for the read stream. This provides access to the stream-buffer implementation used by the read stream.

Note:

Return value

MStreamBuf*

The underlying stream buffer for the read stream.

See also: