CResourceLoader Class Reference

class CResourceLoader : public CBase

Library to handle resource loading when CCoeEnv is not available.

Inherits from

Public Member Functions
~CResourceLoader ()
IMPORT_C HBufC8 * CreateResourceReaderLC ( TResourceReader &, TInt )
IMPORT_C RFs & Fs ()
IMPORT_C HBufC * Load2L ( TInt )
IMPORT_C HBufC * Load2L ( TInt , const TDesC &)
IMPORT_C HBufC * Load2L ( TInt , TInt )
IMPORT_C HBufC * Load2LC ( TInt )
IMPORT_C HBufC * Load2LC ( TInt , const TDesC &)
IMPORT_C HBufC * Load2LC ( TInt , TInt )
IMPORT_C HBufC * LoadLC ( TInt )
IMPORT_C CResourceLoader * NewL (const TDesC &)
Private Member Functions
CResourceLoader ()
void ConstructL (const TDesC &)
TBidiText::TDirectionality DirectionalityL (const TDesC &, TBool *)
HBufC * FormatStringL (const TDesC &, const TDesC &, const TDesC &, TBidiText::TDirectionality )
HBufC * FormatStringL (const TDesC &, const TDesC &, const TDesC &, TBidiText::TDirectionality , TInt &, TInt )
TInt Formater ( TDes &, const TDesC &, const TDesC &, const TDesC &, TBidiText::TDirectionality )
TInt GetParamCount (const TDesC &, TInt )
TInt GetSubStringCount (const TDesC &)
void RemoveNoDirMarkers ( TDes &)
TBidiText::TDirectionality ResolveDirectionality ( TDes &, TBool *)
HBufC * ResolveSubStringDirsL ( TDes &, TInt , TBool *)
HBufC * ResolveSubStringL ( TDes &, TBool *)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
RFs iFs
RResourceFile iResFile

Constructor & Destructor Documentation

CResourceLoader()

CResourceLoader ( ) [private]

A constructor

~CResourceLoader()

~CResourceLoader ( ) [virtual]

Destructor

Member Functions Documentation

ConstructL(const TDesC &)

void ConstructL ( const TDesC & aName ) [private]

A 2nd phase constructor

Parameters

const TDesC & aName a HTML macro, e.g. lt

CreateResourceReaderLC(TResourceReader &, TInt)

IMPORT_C HBufC8 * CreateResourceReaderLC ( TResourceReader & aReader,
TInt aResourceId
) const

Parameters

TResourceReader & aReader a reader
TInt aResourceId a resource key

DirectionalityL(const TDesC &, TBool *)

TBidiText::TDirectionality DirectionalityL ( const TDesC & aText,
TBool * aFound
) [private]

Parameters

const TDesC & aText
TBool * aFound

FormatStringL(const TDesC &, const TDesC &, const TDesC &, TBidiText::TDirectionality)

HBufC * FormatStringL ( const TDesC & aSource,
const TDesC & aKey,
const TDesC & aSubs,
TBidiText::TDirectionality aDir
) [private]

Finds the keystring from the source string and replaces it with the replacement string.

Parameters

const TDesC & aSource
const TDesC & aKey
const TDesC & aSubs
TBidiText::TDirectionality aDir

FormatStringL(const TDesC &, const TDesC &, const TDesC &, TBidiText::TDirectionality, TInt &, TInt)

HBufC * FormatStringL ( const TDesC & aSource,
const TDesC & aKey,
const TDesC & aSubs,
TBidiText::TDirectionality aDirectionality,
TInt & aParamCount,
TInt aSubCount
) [private]

Finds the keystring from the source string and replaces it with the replacement string.

Parameters

const TDesC & aSource
const TDesC & aKey
const TDesC & aSubs
TBidiText::TDirectionality aDirectionality
TInt & aParamCount
TInt aSubCount

Formater(TDes &, const TDesC &, const TDesC &, const TDesC &, TBidiText::TDirectionality)

TInt Formater ( TDes & aDest,
const TDesC & aSource,
const TDesC & aKey,
const TDesC & aSubs,
TBidiText::TDirectionality aDirectionality
) [private]

Finds the keystring from the source string and replaces it with the replacement string. The formated string is stored in the destination descriptor.

Parameters

TDes & aDest
const TDesC & aSource
const TDesC & aKey
const TDesC & aSubs
TBidiText::TDirectionality aDirectionality

Fs()

IMPORT_C RFs & Fs ( )

GetParamCount(const TDesC &, TInt)

TInt GetParamCount ( const TDesC & aText,
TInt aIndex = -1
) [private]

Counts the number of parameters in the text. Needed for correct memory allocations.

Parameters

const TDesC & aText
TInt aIndex = -1

GetSubStringCount(const TDesC &)

TInt GetSubStringCount ( const TDesC & aText ) [private]

Counts the number of substrings (separated by KSubStringSeparators) in the text. Needed for correct memory allocations.

Parameters

const TDesC & aText

Load2L(TInt)

IMPORT_C HBufC * Load2L ( TInt aResourceId )

Parameters

TInt aResourceId a resource key of a resource defined as TBUF

Load2L(TInt, const TDesC &)

IMPORT_C HBufC * Load2L ( TInt aResourceId,
const TDesC & aString
)

Parameters

TInt aResourceId a resource key of a resource defined as TBUF
const TDesC & aString a string value used as parameter in formatting

Load2L(TInt, TInt)

IMPORT_C HBufC * Load2L ( TInt aResourceId,
TInt aInt
)

Parameters

TInt aResourceId a resource key of a resource defined as TBUF
TInt aInt a number to be inserted into the string

Load2LC(TInt)

IMPORT_C HBufC * Load2LC ( TInt aResourceId )

Parameters

TInt aResourceId a resource key of a resource defined as TBUF

Load2LC(TInt, const TDesC &)

IMPORT_C HBufC * Load2LC ( TInt aResourceId,
const TDesC & aString
)

Parameters

TInt aResourceId a resource key of a resource defined as TBUF
const TDesC & aString a string value used as parameter in formatting

Load2LC(TInt, TInt)

IMPORT_C HBufC * Load2LC ( TInt aResourceId,
TInt aInt
)

Parameters

TInt aResourceId a resource key of a resource defined as TBUF
TInt aInt a number to be inserted into the string

LoadLC(TInt)

IMPORT_C HBufC * LoadLC ( TInt aResourceId )

Parameters

TInt aResourceId a resource key of a resource defined as LBUF

NewL(const TDesC &)

IMPORT_C CResourceLoader * NewL ( const TDesC & aName ) [static]

A constructor.

Parameters

const TDesC & aName a resource name

RemoveNoDirMarkers(TDes &)

void RemoveNoDirMarkers ( TDes & aText ) [private]

Removes no dir markers from source text.

Parameters

TDes & aText

ResolveDirectionality(TDes &, TBool *)

TBidiText::TDirectionality ResolveDirectionality ( TDes & aText,
TBool * aFound
) [private]

Resolves directionality of the given source text. Place-holder strings are removed so that they don't affect the result.

Parameters

TDes & aText
TBool * aFound

ResolveSubStringDirsL(TDes &, TInt, TBool *)

HBufC * ResolveSubStringDirsL ( TDes & aText,
TInt aCount,
TBool * aMarker
) [private]

Parameters

TDes & aText
TInt aCount
TBool * aMarker

ResolveSubStringL(TDes &, TBool *)

HBufC * ResolveSubStringL ( TDes & aText,
TBool * aMarker
) [private]

Resolves sub string and directionality of the sub string. Adds no dir marker if directionality of the string not found.

Parameters

TDes & aText
TBool * aMarker

Member Data Documentation

RFs iFs

RFs iFs [private]

RResourceFile iResFile

RResourceFile iResFile [private]