This document provides an overview of literals.
Allows the simple creation of descriptors that contain read-only literal text.
Literal descriptors are not strictly part
of the Descriptors API, as they are not derived from the descriptor
type base class TDesC. However, they have conversion
operators so that they can be passed to any functions which take const TDesC&
or const TRefByValue<const TDesC>
parameters.
The API has two key concepts: literal descriptor, and literal descriptor constructor macro.
Literal descriptor
The literal descriptor stores literal text and provides operators to convert the text into a standard descriptor.
Literal descriptor constructor macro
The literal descriptor constructor macro provides a simple way to create a literal descriptor.
The constructor macro is provided by _LIT16
for
wide strings, and _LIT8
for narrow strings. In Unicode
builds, _LIT
is equivalent to _LIT16
.