CTulStringResourceReader Class Reference
class CTulStringResourceReader : public CBase |
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;
Constructor & Destructor Documentation
CTulStringResourceReader()
CTulStringResourceReader | ( | ) | [private] |
~CTulStringResourceReader()
~CTulStringResourceReader | ( | ) | |
Member Functions Documentation
ConstructL(TFileName &)
By default Symbian OS constructor is private.
ConstructL(TFileName &, RFs &)
By default Symbian OS constructor is private.
NewL(TFileName &)
Creates a new String Resource Reader object.
- leave
- KErrNone, if successful; otherwise one of the other system-wide error codes.
Parameters
TFileName & aResFile | The resource file from which the string(s) are to be read. |
NewL(TFileName &, RFs &)
Creates a new String Resource Reader object.
- leave
- KErrNone, if successful; otherwise one of the other system-wide error codes.
Parameters
TFileName & aResFile | The resource file from which the string(s) are to be read. |
RFs & aFs | A handle to a shared file server session. |
NewLC(TFileName &)
Creates a new String Resource Reader object, and puts a pointer to it onto the cleanup stack.
- leave
- KErrNone, if successful; otherwise one of the other system-wide error codes.
Parameters
TFileName & aResFile | The resource file from which the string(s) are to be read. |
NewLC(TFileName &, RFs &)
Creates a new String Resource Reader object, and puts a pointer to it onto the cleanup stack.
- leave
- KErrNone, if successful; otherwise one of the other system-wide error codes.
Parameters
TFileName & aResFile | The resource file from which the string(s) are to be read. |
RFs & aFs | A handle to a shared file server session. |
ReadResourceString(TInt)
IMPORT_C const TDesC & | ReadResourceString | ( | TInt | aResourceId | ) | |
ReadResourceString: returns the string that match with the resource id. No lenght limitations are imposed on read string.
- panic
- aResourceId If the alignment of Unicode strings within the resource is incorrect,
Member Data Documentation
TBool
iFsConnected
TBool
| iFsConnected | [private] |
HBufC * iResourceBuffer
HBufC * | iResourceBuffer | [private] |
RResourceFile iResourceFile
RResourceFile | iResourceFile | [private] |
TPtrC
iTruncatedTextPointer
TPtrC
| iTruncatedTextPointer | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.