diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-0C8389B8-91DF-58A1-A2A1-945A18CCBB10.dita --- a/Symbian3/PDK/Source/GUID-0C8389B8-91DF-58A1-A2A1-945A18CCBB10.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-0C8389B8-91DF-58A1-A2A1-945A18CCBB10.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,64 +1,64 @@ - - - - - -Using -TLitC operatorsExplains how to use TLitC operations. -

The TLitC class offers four operators, two of which are -conversion operators.

-

The conversion operators are invoked by the compiler when a TLitC<TInt> type -is passed to a function which takes the following argument types:

- -

The other two operators return:

- -

The following code fragments show the situations where the operators are -called on a TLitC. The fragments are similar for both TLitC8 and TLitC16.

-
Reference by value conversion operator operator const __TRefDesC()

The -following code fragment shows the operator in use:

... -TBuf<256> x; -... -_LIT(KTxtFormat,"There are %d cm in a metre"); -x.Format(KTxtFormat,100); -... -
-
Const descriptor reference conversion operator operator const -TDesC&

The following code fragment shows the operator in use:

... -_LIT(KSomeData,"Some data"); -... -TPtrC x(KSomeData);
-
Address of operator operator&()

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); -...
-
Reference operator operator()

The following code -fragment shows the operator in use:

... -_LIT(KKeywordSelect,"select"); -if (KKeywordSelect().CompareF(token)<0) -...
+ + + + + +Using +TLitC operatorsExplains how to use TLitC operations. +

The TLitC class offers four operators, two of which are +conversion operators.

+

The conversion operators are invoked by the compiler when a TLitC<TInt> type +is passed to a function which takes the following argument types:

+
    +
  • a reference by value, +i.e. a TRefByValue<class T> type

  • +
  • a const reference to +a descriptor, i.e. a const TDesC& type

  • +
+

The other two operators return:

+
    +
  • a pointer to a constant +descriptor, i.e. a const TDesC* type

  • +
  • a reference to a constant +descriptor, i.e. a const TDesC& type

  • +
+

The following code fragments show the situations where the operators are +called on a TLitC. The fragments are similar for both TLitC8 and TLitC16.

+
Reference by value conversion operator operator const __TRefDesC()

The +following code fragment shows the operator in use:

... +TBuf<256> x; +... +_LIT(KTxtFormat,"There are %d cm in a metre"); +x.Format(KTxtFormat,100); +... +
+
Const descriptor reference conversion operator operator const +TDesC&

The following code fragment shows the operator in use:

... +_LIT(KSomeData,"Some data"); +... +TPtrC x(KSomeData);
+
Address of operator operator&()

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); +...
+
Reference operator operator()

The following code +fragment shows the operator in use:

... +_LIT(KKeywordSelect,"select"); +if (KKeywordSelect().CompareF(token)<0) +...
\ No newline at end of file