EPOC   SDK Home Glossary Indexes Previous   Up

TLitC16 class


Contents


TLitC16<TInt S> class — 16 bit constant literal

Section Contents


Overview

Derivation

Not applicable

Defined in

e32des16.h

Link against

euser.lib

Description

A TLitC16<TInt S> object contains literal text. Such an object is normally constructed by coding an _LIT16 macro.

This class is build independent; i.e. an explicit 16 bit build variant is generated for both a non-Unicode build and a Unicode build.


Construction

The class has no explicit constructors. See the _LIT16 macro definition.


Operators


operator const TDesC16& — Conversion operator

operator const TDesC16& () const;

When used

This conversion operator is invoked by the compiler when a TLitC16<TInt S> type is passed to a function which is prototyped to take a const TDesC16& type.


operator const TRefByValue<const TDesC16> — Conversion operator

operator const TRefByValue<const TDesC16>() const;

When used

This conversion operator is invoked by the compiler when a TLitC16<TInt S> type is passed to a function which is prototyped to take a const TRefByValue<const TDesC16> type.


operator& — Address of operator

const TDesC16* operator&();

Description

Use this operator to return a const TDesC16 type pointer

Return value

const TDesC16*

A descriptor type pointer to this literal.

Example

The following code fragment shows the operator in use:

    class CX...
          {
          void Foo(const TDesC16* aDesC);
          };
    
    ...
    _LIT16(KLiteral,"some text");
    ...
    CX* anx;
    ...
    anx->Foo(&KLiteral);
    ...

operator() — Reference operator

const TDesC16& operator()();

Description

Use this operator to return a const TDesC16 type reference.

Return value

const TDesC16&

A descriptor type reference to this literal

Example

The following code fragment shows the operator in use:

    _LIT16(KKeywordSelect,"select");
    if (KKeywordSelect().CompareF(token)<0)
    ...
EPOC       SDK Home Glossary Indexes Previous   Up