![]() |

Section Contents
Not applicable
e32std.h
euser.lib
A TLitC<TInt S> object contains literal text. Such an object is constructed by coding an _LIT macro.
This class is build independent; i.e. for a non-Unicode build, an 8 bit build variant is generated; for a non Unicode build, a 16 bit build variant is generated.
The class has no explicit constructors. See the _LIT macro definition.
operator const TDesC& () const;
This conversion operator is invoked by the compiler when a TLitC<TInt S> type is passed to a function which is prototyped to take a const TDesC& type.
operator const TRefByValue<const TDesC>() const;
This conversion operator is invoked by the compiler when a TLitC<TInt S> type is passed to a function which is prototyped to take a const TRefByValue<const TDesC> type.
...
TBuf<256> x;
...
_LIT(KTxtFormat,"There are %d cm in a metre");
x.Format(KTxtFormat,100);
...
const TDesC* operator&();
Use this operator to return a const TDesC type pointer
|
const TDesC* |
A descriptor type pointer to this literal. |
The following code fragment shows the operator in use:
class CX...
{
void Foo(const TDesC* aDesC);
};
...
_LIT(KLiteral,"some text");
...
CX* anx;
...
anx->Foo(&KLiteral);
...
const TDesC& operator()();
Use this operator to return a const TDesC type reference.
|
const TDesC& |
A descriptor type reference to this literal |
The following code fragment shows the operator in use:
...
_LIT(KKeywordSelect,"select");
if (KKeywordSelect().CompareF(token)<0)
...
|
|