#include <mw/tulstringresourcereader.h>
Link against: etul.lib
class CTulStringResourceReader : public CBase |
Public Member Functions | |
---|---|
~CTulStringResourceReader() | |
IMPORT_C CTulStringResourceReader * | NewL(TFileName &) |
IMPORT_C CTulStringResourceReader * | NewL(TFileName &, RFs &) |
IMPORT_C CTulStringResourceReader * | NewLC(TFileName &) |
IMPORT_C CTulStringResourceReader * | NewLC(TFileName &, RFs &) |
IMPORT_C const TDesC & | ReadResourceString(TInt) |
CTulStringResourceReader reads strings from resource without CCoeEnv. If resource file given to the constructor is not found, the constructor leaves. This module is mainly for server usage, where there is the need to read resources, but no CCoeEnv instance is present.
Usage:
#include <platform/stringresourcereader.h> #include <errorres.rsg> // Resource to be read header TFileName myFileName( _L("z:\\resource\\errorres.rsc") ); CTulStringResourceReader* test = CTulStringResourceReader::NewL( myFileName ); TPtrC buf; buf.Set(test-> ReadResourceString(R_ERROR_RES_GENERAL)); // Note that buf will only be valid as long as CTulStringResourceReader // instance is alive and no new string is read by the same instance. // If you need to read multiple strings, make copies. delete test;
~CTulStringResourceReader | ( | ) |
IMPORT_C CTulStringResourceReader * | NewL | ( | TFileName & | aResFile | ) | [static] |
Parameters | |
---|---|
aResFile | The resource file from which the string(s) are to be read. |
Leave Codes | |
---|---|
KErrNone, | if successful; otherwise one of the other system-wide error codes. |
IMPORT_C CTulStringResourceReader * | NewL | ( | TFileName & | aResFile, |
RFs & | aFs | |||
) | [static] |
Parameters | |
---|---|
aResFile | The resource file from which the string(s) are to be read. |
aFs | A handle to a shared file server session. |
Leave Codes | |
---|---|
KErrNone, | if successful; otherwise one of the other system-wide error codes. |
IMPORT_C CTulStringResourceReader * | NewLC | ( | TFileName & | aResFile | ) | [static] |
Parameters | |
---|---|
aResFile | The resource file from which the string(s) are to be read. |
Leave Codes | |
---|---|
KErrNone, | if successful; otherwise one of the other system-wide error codes. |
IMPORT_C CTulStringResourceReader * | NewLC | ( | TFileName & | aResFile, |
RFs & | aFs | |||
) | [static] |
Parameters | |
---|---|
aResFile | The resource file from which the string(s) are to be read. |
aFs | A handle to a shared file server session. |
Leave Codes | |
---|---|
KErrNone, | if successful; otherwise one of the other system-wide error codes. |
Panic Codes | |
---|---|
aResourceId | If the alignment of Unicode strings within the resource is incorrect, |