Using TDes

Use TDes for interfaces which take narrow or wide (Unicode) text, depending on the build variant.

Usage in a function interface

An interface which needs to access and modify either narrow text or wide (Unicode) text, depending on the build variant, uses a TDes as the argument type. All build independent concrete descriptors are derived from TDes which means that the interface can accept any build independent descriptor.

The following code fragment shows the most common function prototype pattern.

void ClassX::foo(TDes& anArg);

The use of TDes means that data can be accessed and modified through the descriptor.

If the interface is to handle explicit 8 bit or explicit 16 bit data, regardless of the build variant, then use TDes8 or TDes16 instead.

Related concepts