RResourceArchive Class Reference

class RResourceArchive

Class for accessing the resource archive SPI file

Public Member Functions
RResourceArchive ()
IMPORT_C void Close ()
IMPORT_C TBool End ()
IMPORT_C CResourceFile * NextL ( HBufC *&)
IMPORT_C void OpenL ( RFs &, const TDesC &)
IMPORT_C void OpenL ( RFs &, const TDesC &, const TDesC &)
IMPORT_C void Reset ()
IMPORT_C TUid Type ()
Private Attributes
CResourceArchiveImpl * iArchiveImpl

Constructor & Destructor Documentation

RResourceArchive()

IMPORT_C RResourceArchive ( )

Constructs a default resource archive reader object.

Member Functions Documentation

Close()

IMPORT_C void Close ( )

Closes the resource archive(SPI) reader. This function is called after finishing reading all resources.

End()

IMPORT_C TBool End ( )
Look ahead in the resource archive to check whether there is still any resource in the archive to be read
Pre-condition
RResourceArchive::OpenL must be called beforehand

NextL(HBufC *&)

IMPORT_C CResourceFile * NextL ( HBufC *& aRscFileName )
Creates an instance of CResourceFile which corresponds to the next rsc file in the resource archive file(SPI)
leave
KErrNoMemory if there is not enough memory for the object
panic
If the file is corrupted - the method will panic in debug mode

Parameters

HBufC *& aRscFileName the rsc file name buffer passed in by client

OpenL(RFs &, const TDesC &)

IMPORT_C void OpenL ( RFs & aFs,
const TDesC & aName
)
Open the resource archive reader
leave
The function leaves if the named file cannot be found or the header record at the beggining of the file cannot be read
panic
If the file is corrupted - the method will panic in debug mode.

Parameters

RFs & aFs Handle to a file server session
const TDesC & aName File to open as a resource archive file

OpenL(RFs &, const TDesC &, const TDesC &)

IMPORT_C void OpenL ( RFs & aFs,
const TDesC & aSpiPath,
const TDesC & aSpiName
)

Open the resource archive reader, this is usually used in composite rom drive situation where multiple independent rom images are mapped to a single rom drive and each rom image may consist 0..n spi files. Spi files in each rom image are labelled with the rom image id(example ecom-<id>-0.spi) with the id itself indicating the order of mounting/reading of the spi files. RResourceArchive will always mount/read the spi files in ascending order of the rom image id i.e. ecom-2-0.spi is mounted after ecom-1-0.spi and etc.

As a result of this mounting order,it is possible to replace a resource inside an spi with the resource with same name from a later mounted spi. It is also possible to specify in an spi file the hiding of resource in another spi file.(See example below)

In the presence of localised spi files(ecom-<id>-0.sNN where NN is language code) the spi files will be resolved internally based on existing language downgrade path.(See example below)

         Example of use case:
z:\private\10009d8f\ecom-0-0.spi	(ROM IMAGE 0)
z:\private\10009d8f\ecom-0-1.s02	(ROM IMAGE 0)
z:\private\10009d8f\ecom-1-0.spi	(ROM IMAGE 1)
In this situation the function call to RResourceArchive should be:
RResourceArchive::OpenL(RFs,_L("z:\\private\\10009d8f\\"),_L("ecom"));

Example of multiple spi files and the visibility of the resource files
under two different language downgrade path(DGP):
-------------------------------------------------------------------------------
            |              |              |              |Resource  Visibility  
Ecom-1-0.spi| Ecom-1-0.s02 | Ecom-2-0.spi | Ecom-2-0.s02 |DGP(1)   | DGP(2-1)
-------------------------------------------------------------------------------
A.RSC		|	A.R02	   |   B.RSC	  |  Hide D.R02  |A.RSC(1) | A.R02(1)
B.RSC	    |	D.R02	   |			  |  C.R02       |B.RSC(2) | B.RSC(2)
C.RSC       |              |              |              |C.RSC(1) | C.R02(2)
-------------------------------------------------------------------------------
        
leave
KErrNotFound if there is no single file matching aSpiName in the path KErrCorrupt if the spi file is corrupted
panic
EBafPanicBadResourceFileFormat if the spi files that match the pattern do not share a common spi type.

Parameters

RFs & aFs Handle to a file server session
const TDesC & aSpiPath full path of the folder that contains the spi file
const TDesC & aSpiName the default spi name without any image id and extension

Reset()

IMPORT_C void Reset ( )

Reset the CResourceArchiveIter to start reading the first rsc file from the resourc archive(SPI) file

Type()

IMPORT_C TUid Type ( )

Return the type of the resource archive(SPI) file being opened

Member Data Documentation

CResourceArchiveImpl * iArchiveImpl

CResourceArchiveImpl * iArchiveImpl [private]