#include <baspi.h>
class RResourceArchive |
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() |
Class for accessing the resource archive SPI file
IMPORT_C | RResourceArchive | ( | ) |
Constructs a default resource archive reader object.
IMPORT_C void | Close | ( | ) |
Closes the resource archive(SPI) reader. This function is called after finishing reading all resources.
IMPORT_C TBool | End | ( | ) |
Returns: boolean indicating whether the next resource exists
IMPORT_C CResourceFile * | NextL | ( | HBufC *& | aRscFileName | ) |
Parameter | Description |
---|---|
aRscFileName | the rsc file name buffer passed in by client |
Returns: CResourceFile pointer of the next resource file in the SPI NULL if there is no more resource file to read from the SPI
Parameter | Description |
---|---|
aFs | Handle to a file server session |
aName | File to open as a resource archive file |
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) -------------------------------------------------------------------------------
Parameter | Description |
---|---|
aFs | Handle to a file server session |
aSpiPath | full path of the folder that contains the spi file |
aSpiName | the default spi name without any image id and extension |
IMPORT_C void | Reset | ( | ) |
Reset the CResourceArchiveIter to start reading the first rsc file from the resourc archive(SPI) file
IMPORT_C TUid | Type | ( | ) |
Return the type of the resource archive(SPI) file being opened
Returns: the TUid type of the resource archive(SPI) file