|
||
class RResourceReader;
Interprets resource data read from a resource file.
To use an instance of this class, pass the CResourceFile
object containing the resource data with aResourceId ID to it, by calling RResourceReader::OpenL(const CResourceFile *,TInt)
or RResourceReader::OpenLC(const CResourceFile *,TInt)
. Close the reader calling RResourceReader::Close()
after finishing with the resource.
The current position within the buffer is always maintained and any request for data is always supplied from the current position. The current position is always updated .
Expected behaviour when assignment operator or copy constructor is called: The class doesn't have assignment operator and copy constructor, so the compiler generated ones will be used. The buffer used by the source class instance will be shared with the destination class instance. However source and destination instances will have their own current position pointers, both pointed initially to the same buffer position.
Defined in RResourceReader
:
AdvanceL(TInt)
Moves the current buffer position forwards by the specified amount. If the resul...Close()
Destroys the buffer containing the resource data.OpenL(const CResourceFile *,TInt)
Sets the buffer containing the resource data.OpenL(const TDesC8 &)
Sets the buffer containing the resource data.OpenLC(const CResourceFile *,TInt)
Sets the buffer containing the resource data.OpenLC(const TDesC8 &)
Sets the buffer containing the resource data.RResourceReader()
It creates the implementation in place - iImpl array, and sets the default leave...ReadDesC16ArrayL()
Interprets the data at the current buffer position as an array of leading byte c...ReadDesC8ArrayL()
Interprets the data at the current buffer position as an array of leading byte c...ReadDesCArrayL()
Interprets the data at the current buffer position as an array of leading byte c...ReadHBufC16L()
Interprets the data at the current buffer position as leading byte count data an...ReadHBufC8L()
Interprets the data at the current buffer position as leading byte count data an...ReadHBufCL()
Interprets the data at the current buffer position as leading byte count data an...ReadInt16L()
Interprets the data at the current buffer position as a TInt16 type and returns ...ReadInt32L()
Interprets the data at the current buffer position as a TInt32 type and returns ...ReadInt8L()
Interprets the data at the current buffer position as a TInt8 type and returns t...ReadL(TAny *,TInt)
Copies a specified length of data from the resource buffer, starting at the curr...ReadReal64L()
Interprets the data at the current buffer position as a TReal64 type and returns...ReadTPtrC16L()
Interprets the data at the current buffer position as leading byte count data an...ReadTPtrC8L()
Interprets the data at the current buffer position as leading byte count data an...ReadTPtrCL()
Interprets the data at the current buffer position as leading byte count data an...ReadUint16L()
Interprets the data at the current buffer position as a TUint16 type and returns...ReadUint32L()
Interprets the data at the current buffer position as a TUint32 type and returns...ReadUint8L()
Interprets the data at the current buffer position as a TUint8 type and returns ...RewindL(TInt)
Moves the current buffer position backwards by the specified amount.~RResourceReader()
The method calls RResourceReader::Close() method to release allocated by the ins...CResourceFile
Accesses a resource file or resource file buffer and reads the resource data int...IMPORT_C RResourceReader();
It creates the implementation in place - iImpl array, and sets the default leave/panic behaviour of the object - the object "L" methods will leave if something goes wrong.
IMPORT_C ~RResourceReader();
The method calls RResourceReader::Close()
method to release allocated by the instance resources.
IMPORT_C void OpenL(const CResourceFile *aRscFile, TInt aResourceId);
Sets the buffer containing the resource data.
The current position within the buffer is set to the start of the buffer so that subsequent calls to the interpreting functions, for example ReadInt8(), start at the beginning of this buffer.
|
|
IMPORT_C void OpenLC(const CResourceFile *aRscFile, TInt aResourceId);
Sets the buffer containing the resource data.
The current position within the buffer is set to the start of the buffer so that subsequent calls to the interpreting functions, for example ReadInt8(), start at the beginning of this buffer.
A pointer to current RResourceReader instance is placed into the cleanup stack.
|
|
IMPORT_C void OpenL(const TDesC8 &aRscData);
Sets the buffer containing the resource data.
The current position within the buffer is set to the start of the buffer so that subsequent calls to the interpreting functions, for example ReadInt8(), start at the beginning of this buffer.
|
IMPORT_C void OpenLC(const TDesC8 &aRscData);
Sets the buffer containing the resource data.
The current position within the buffer is set to the start of the buffer so that subsequent calls to the interpreting functions, for example ReadInt8(), start at the beginning of this buffer.
A pointer to current RResourceReader instance is placed into the cleanup stack.
|
IMPORT_C void Close();
Destroys the buffer containing the resource data.
Open() method should be called if you want to set the buffer and current position again.
If a one or more copies of the same RResourceReader object exist - they share the same resource data buffer. So destroying the RResourceReader object you will destroy the shared resource data buffer.
Buffer pointer is set to NULL.
Buffer current position pointer is set to NULL.
IMPORT_C HBufC* ReadHBufCL();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as leading byte count data and constructs a build independent heap descriptor containing a copy of this data.
The data is interpreted as:
a byte value defining the number of text characters or the length of binary data (the resource string/binary data length is limited to 255 characters max)
followed by:
the text characters or binary data. This resource data is interpreted as either 8Â bit or 16Â bit, depending on the build.
If the value of the leading byte is zero, the function assumes that no data follows the leading byte and returns a NULL pointer.
The current position within the resource buffer is updated.
Use this build independent variant when the resource contains text. If the resource contains binary data, use the explicit
8Â bit variant RResourceReader::ReadHBufC8L()
.
Current buffer position is updated.
|
|
IMPORT_C HBufC8* ReadHBufC8L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as leading byte count data and constructs an 8 bit heap descriptor containing a copy of this data.
The data is interpreted as:
a byte value defining the number of 8 bit text characters or the length of binary data (the resource string/binary data length is limited to 255 characters max)
followed by:
the 8 bit text characters or binary data.
If the value of the leading byte is zero, the function assumes that no data follows the leading byte and returns a NULL pointer.
The current position within the resource buffer is updated.
Use this explicit 8Â bit variant when the resource contains binary data. If the resource contains text, then use the build
independent variant RResourceReader::ReadHBufCL()
.
In general, this type of resource data corresponds to one of the following:
a LTEXT type in a resource STRUCT declaration.
a variable length array within a STRUCT declaration which includes the LEN BYTE keywords.
Current buffer position is updated.
|
|
IMPORT_C HBufC16* ReadHBufC16L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as leading byte count data and constructs a 16 bit heap descriptor containing a copy of this data.
The data is interpreted as:
a byte value defining the number of 16 bit text characters (the resource string/binary data length is limited to 255 characters max)
followed by:
the 16 bit text characters.
If the value of the leading byte is zero, the function assumes that no data follows the leading byte and returns a NULL pointer.
The current position within the resource buffer is updated.
Do not use this explicit 16Â bit variant when the resource contains binary data; use the explicit 8Â bit variant instead.
If the resource contains text, use the build independent variant RResourceReader::ReadHBufCL()
.
Current buffer position is updated.
|
|
IMPORT_C TPtrC ReadTPtrCL();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as leading byte count data and constructs a non modifiable pointer descriptor to represent this data.
The data is interpreted as:
a byte value defining the number of text characters or the length of binary data (the resource string/binary data length is limited to 255 characters max)
followed by:
the text characters or binary data. This resource data is interpreted as either 8Â bit or 16Â bit, depending on the build.
If the value of the leading byte is zero, calling Length() on the returned TPtrC returns zero.
The current position within the resource buffer is updated.
Use this build independent variant when the resource contains text. If the resource contains binary data, use the explicit 8Â bit variant ReadTPtrC8().
Current buffer position is updated.
|
|
IMPORT_C TPtrC8 ReadTPtrC8L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as leading byte count data and constructs an 8 bit non modifiable pointer descriptor to represent this data.
The data is interpreted as:
a byte value defining the number of text characters or the length of binary data (the resource string/binary data length is limited to 255 characters max)
followed by:
the 8 bit text characters or binary data.
If the value of the leading byte is zero, calling Length() on the returned TPtrC8
returns zero.
The current position within the resource buffer is updated.
Use this explicit 8Â bit variant when the resource contains binary data. If the resource contains text, then use the build independent variant ReadTPtrC().
In general, this type of resource data corresponds to one of the following:
a LTEXT type in a resource STRUCT declaration.
a variable length array within a STRUCT declaration which includes the LEN BYTE keywords.
Current buffer position is updated.
|
|
IMPORT_C TPtrC16 ReadTPtrC16L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as leading byte count data and constructs a 16 bit non modifiable pointer descriptor to represent this data.
The data is interpreted as:
a byte value defining the number of 16 bit text characters (the resource string/binary data length is limited to 255 characters max)
followed by:
the 16 bit text characters.
If the value of the leading byte is zero, calling Length() on the returned TPtrC16
returns zero.
The current position within the resource buffer is updated.
Do not use this explicit 16Â bit variant when the resource contains binary data; use the explicit 8Â bit variant instead. If the resource contains text, use the build independent variant ReadTPtrC().
Current buffer position is updated.
|
|
IMPORT_C CDesCArrayFlat* ReadDesCArrayL();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as an array of leading byte count data and constructs a build independent flat array of descriptors.
Each descriptor in the descriptor array corresponds to an element of the resource array.
At the current buffer position, the buffer is expected to contain an array of data elements preceded by a TInt16 value defining the number of elements within that array.
Each element of the array is interpreted as:
a byte value defining the number of text characters or the length of binary data (the resource string/binary data length is limited to 255 characters max)
followed by:
the text characters or binary data. This resource data is interpreted as either 8Â bit or 16Â bit, depending on the build.
The current position within the resource buffer is updated.
Use this build independent variant when the elements contain text. If the elements contain binary data, use the explicit 8Â bit
variant RResourceReader::ReadDesC8ArrayL()
.
Current buffer position is updated.
|
|
IMPORT_C CDesC8ArrayFlat* ReadDesC8ArrayL();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as an array of leading byte count data and constructs a flat array of 8 bit descriptors.
Each descriptor in the descriptor array corresponds to an element of the resource array.
At the current buffer position, the buffer is expected to contain an array of data elements preceded by a TInt16 value defining the number of elements within that array.
Each element of the array is interpreted as:
a byte value defining the number of 8 bit text characters or the length of binary data (the resource string/binary data length is limited to 255 characters max)
followed by:
the text characters or binary data.
The current position within the resource buffer is updated.
Use this explicit 8Â bit variant when the resource contains binary data. If the elements of the resource array contain text,
use the build independent variant of RResourceReader::ReadDesCArrayL()
.
Current buffer position is updated.
|
|
IMPORT_C CDesC16ArrayFlat* ReadDesC16ArrayL();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as an array of leading byte count data and constructs a flat array of 16 bit descriptors.
Each descriptor in the descriptor array corresponds to an element of the resource array.
At the current buffer position, the buffer is expected to contain an array of data elements preceded by a TInt16 value defining the number of elements within that array.
Each element of the array is interpreted as:
a byte value defining the number of 8 bit text characters or the length of binary data (the resource string/binary data length is limited to 255 characters max)
followed by:
the 16 bit text characters.
The current position within the resource buffer is updated.
Do not use this explicit 16Â bit variant when the resource contains binary data; use the explicit 8Â bit variant instead.
If the resource contains text, use the build independent variant RResourceReader::ReadDesCArrayL()
.
Current buffer position is updated.
|
|
IMPORT_C TInt ReadInt8L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as a TInt8 type and returns the value as a TInt.
The current position within the resource buffer is updated.
In general, a TInt8 corresponds to a BYTE type in a resource STRUCT declaration.
Note that in Symbian OS, a TInt is at least as big as a TInt8.
Current buffer position is updated.
|
|
IMPORT_C TUint ReadUint8L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as a TUint8 type and returns the value as a TUint.
The current position within the resource buffer is updated.
In general, a TUint8 corresponds to a BYTE type in a resource STRUCT declaration.
Note that in Symbian OS, a TUint is at least as big as a TUint8.
Current buffer position is updated.
|
|
IMPORT_C TInt ReadInt16L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as a TInt16 type and returns the value as a TInt.
The current position within the resource buffer is updated.
In general, a TInt16 corresponds to a WORD type in a resource STRUCT declaration.
Note that in Symbian OS, a TInt is at least as big as a TInt16.
Current buffer position is updated.
|
|
IMPORT_C TUint ReadUint16L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as a TUint16 type and returns the value as a TUint.
The current position within the resource buffer is updated.
In general, a TUint16 corresponds to a WORD type in a resource STRUCT declaration.
Note that in Symbian OS, a TUint is at least as big as a TUint16.
Current buffer position is updated.
|
|
IMPORT_C TInt ReadInt32L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as a TInt32 type and returns the value as a TInt.
The current position within the resource buffer is updated.
In general, a TInt32 corresponds to a LONG type in a resource STRUCT declaration.
Note that in Symbian OS, TInt and TInt32 are the same size.
Current buffer position is updated.
|
|
IMPORT_C TUint ReadUint32L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as a TUint32 type and returns the value as a TUint.
The current position within the resource buffer is updated.
In general, a TUint32 corresponds to a LONG type in a resource STRUCT declaration.
Note that in Symbian OS a TUint is the same size as a TUint32.
Current buffer position is updated.
|
|
IMPORT_C TReal64 ReadReal64L();
Open() is called to initialize RResourceReader data members.
Interprets the data at the current buffer position as a TReal64 type and returns the value as a TReal64.
The current position within the resource buffer is updated.
In general, a TReal64 corresponds to a DOUBLE type in a resource STRUCT declaration.
Current buffer position is updated.
|
|
IMPORT_C void ReadL(TAny *aPtr, TInt aLength);
Open() is called to initialize RResourceReader data members.
Copies a specified length of data from the resource buffer, starting at the current position within the buffer, into the location pointed to by a specified pointer. No assumption is made about the type of data at being read.
The current position within the resource buffer is updated.
Current buffer position is updated.
|
|
IMPORT_C void RewindL(TInt aLength);
Open() is called to initialize RResourceReader data members.
Moves the current buffer position backwards by the specified amount.
Current buffer position is updated.
|
|
IMPORT_C void AdvanceL(TInt aLength);
Open() is called to initialize RResourceReader data members.
Moves the current buffer position forwards by the specified amount. If the resulting position lies beyond the end of the resource buffer, then the function leaves with KErrEof code.
Current buffer position is updated.
|
|