Explains 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.
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); ...
The following code fragment shows the operator in use:
... _LIT(KSomeData,"Some data"); ... TPtrC x(KSomeData);
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.