TDesC16 Class Reference

class TDesC16

Abstract base class for 16-bit descriptors.

The class encapsulates the data member containing the length of data represented by a 16-bit descriptor. It also provides member functions through which the data can be accessed, but not modified.

Data represented by this class is treated as a contiguous set of 16-bit (i.e. double byte) values or data items.

This class cannot be instantiated as it is intended to form part of a class hierarchy; it provides a well defined part of descriptor behaviour. It can, however, be passed as an argument type for functions which want access to descriptor data but do not need to modify that data.

TDesC

TPtrC16

Public Member Functions
IMPORT_C HBufC16 *Alloc()
IMPORT_C HBufC16 *AllocL()
IMPORT_C HBufC16 *AllocLC()
IMPORT_C TIntCompare(const TDesC16 &)
IMPORT_C TIntCompareC(const TDesC16 &)
IMPORT_C TIntCompareC(const TDesC16 &, TInt, const TCollationMethod *)
IMPORT_C TIntCompareF(const TDesC16 &)
IMPORT_C TIntFind(const TDesC16 &)
IMPORT_C TIntFind(const TUint16 *, TInt)
IMPORT_C TIntFindC(const TDesC16 &)
IMPORT_C TIntFindC(const TUint16 *, TInt)
IMPORT_C TIntFindC(const TUint16 *, TInt, TInt)
IMPORT_C TIntFindC(const TDesC16 &, TInt &, const TCollationMethod &, TInt)
IMPORT_C TIntFindF(const TDesC16 &)
IMPORT_C TIntFindF(const TUint16 *, TInt)
IMPORT_C HBufC8 *GetCollationKeysL(TInt, const TCollationMethod *)
IMPORT_C HBufC16 *GetFoldedDecomposedFormL()
IMPORT_C HBufC16 *GetNormalizedDecomposedFormL()
IMPORT_C TPrefixHasPrefixC(const TDesC16 &, TInt, const TCollationMethod *)
IMPORT_C TPtrC16Left(TInt)
TInt Length()
IMPORT_C TIntLocate(TChar)
IMPORT_C TIntLocateF(TChar)
IMPORT_C TIntLocateReverse(TChar)
IMPORT_C TIntLocateReverseF(TChar)
IMPORT_C TIntMatch(const TDesC16 &)
IMPORT_C TIntMatchC(const TDesC16 &)
IMPORT_C TIntMatchC(const TDesC16 &, TInt, TInt, TInt, TInt, const TCollationMethod *)
IMPORT_C TIntMatchC(const TDesC16 &, const TCollationMethod *, TInt, TInt, TInt, TInt)
IMPORT_C TIntMatchF(const TDesC16 &)
IMPORT_C TPtrC16Mid(TInt)
IMPORT_C TPtrC16Mid(TInt, TInt)
IMPORT_C const TUint16 *Ptr()
IMPORT_C TPtrC16Right(TInt)
TInt Size()
TBool operator!=(const TDesC16 &)
TBool operator<(const TDesC16 &)
TBool operator<=(const TDesC16 &)
TBool operator==(const TDesC16 &)
TBool operator>(const TDesC16 &)
TBool operator>=(const TDesC16 &)
const TUint16 &operator[](TInt)
Protected Member Functions
TDesC16()
TDesC16(TInt, TInt)
IMPORT_C const TUint16 &AtC(TInt)
voidDoSetLength(TInt)
TInt Type()
Public Member Enumerations
enumTPrefix { EIsPrefix = 0, EMightBePrefix = 1, EIsNotPrefix = 2 }
Private Attributes
__DECLARE_TEST
TUint iLength

Constructor & Destructor Documentation

TDesC16()

TDesC16()[protected, inline]

TDesC16(TInt, TInt)

TDesC16(TIntaType,
TIntaLength
)[protected, inline]

Parameters

TInt aType
TInt aLength

Member Functions Documentation

Alloc()

IMPORT_C HBufC16 *Alloc()const

AllocL()

IMPORT_C HBufC16 *AllocL()const

AllocLC()

IMPORT_C HBufC16 *AllocLC()const

AtC(TInt)

IMPORT_C const TUint16 &AtC(TIntanIndex)const [protected]

Parameters

TInt anIndex

Compare(const TDesC16 &)

IMPORT_C TIntCompare(const TDesC16 &aDes)const

Parameters

const TDesC16 & aDes

CompareC(const TDesC16 &)

IMPORT_C TIntCompareC(const TDesC16 &aDes)const

Parameters

const TDesC16 & aDes

CompareC(const TDesC16 &, TInt, const TCollationMethod *)

IMPORT_C TIntCompareC(const TDesC16 &aDes,
TIntaMaxLevel,
const TCollationMethod *aCollationMethod
)const

Parameters

const TDesC16 & aDes
TInt aMaxLevel
const TCollationMethod * aCollationMethod

CompareF(const TDesC16 &)

IMPORT_C TIntCompareF(const TDesC16 &aDes)const

Parameters

const TDesC16 & aDes

DoSetLength(TInt)

voidDoSetLength(TIntaLength)[protected, inline]

Parameters

TInt aLength

Find(const TDesC16 &)

IMPORT_C TIntFind(const TDesC16 &aDes)const

Parameters

const TDesC16 & aDes

Find(const TUint16 *, TInt)

IMPORT_C TIntFind(const TUint16 *aBuf,
TIntaLen
)const

Parameters

const TUint16 * aBuf
TInt aLen

FindC(const TDesC16 &)

IMPORT_C TIntFindC(const TDesC16 &aDes)const

Parameters

const TDesC16 & aDes

FindC(const TUint16 *, TInt)

IMPORT_C TIntFindC(const TUint16 *aBuf,
TIntaLen
)const

Parameters

const TUint16 * aBuf
TInt aLen

FindC(const TUint16 *, TInt, TInt)

IMPORT_C TIntFindC(const TUint16 *aText,
TIntaLength,
TIntaMaxLevel
)const

Parameters

const TUint16 * aText
TInt aLength
TInt aMaxLevel

FindC(const TDesC16 &, TInt &, const TCollationMethod &, TInt)

IMPORT_C TIntFindC(const TDesC16 &aDes,
TInt &aLengthFound,
const TCollationMethod &aMethod,
TIntaMaxLevel
)const

Parameters

const TDesC16 & aDes
TInt & aLengthFound
const TCollationMethod & aMethod
TInt aMaxLevel

FindF(const TDesC16 &)

IMPORT_C TIntFindF(const TDesC16 &aDes)const

Parameters

const TDesC16 & aDes

FindF(const TUint16 *, TInt)

IMPORT_C TIntFindF(const TUint16 *aBuf,
TIntaLen
)const

Parameters

const TUint16 * aBuf
TInt aLen

GetCollationKeysL(TInt, const TCollationMethod *)

IMPORT_C HBufC8 *GetCollationKeysL(TIntaMaxLevel,
const TCollationMethod *aCollationMethod
)const

Parameters

TInt aMaxLevel
const TCollationMethod * aCollationMethod

GetFoldedDecomposedFormL()

IMPORT_C HBufC16 *GetFoldedDecomposedFormL()const

GetNormalizedDecomposedFormL()

IMPORT_C HBufC16 *GetNormalizedDecomposedFormL()const

HasPrefixC(const TDesC16 &, TInt, const TCollationMethod *)

IMPORT_C TPrefixHasPrefixC(const TDesC16 &aPossiblePrefix,
TIntaLevel,
const TCollationMethod *aCollationMethod
)const

Parameters

const TDesC16 & aPossiblePrefix
TInt aLevel
const TCollationMethod * aCollationMethod

Left(TInt)

IMPORT_C TPtrC16Left(TIntaLength)const

Parameters

TInt aLength

Length()

TInt Length()const [inline]

Gets the length of the data.

This is the number of 16-bit values or data items represented by the descriptor.

The length of the data represented by the descriptor.

Locate(TChar)

IMPORT_C TIntLocate(TCharaChar)const

Parameters

TChar aChar

LocateF(TChar)

IMPORT_C TIntLocateF(TCharaChar)const

Parameters

TChar aChar

LocateReverse(TChar)

IMPORT_C TIntLocateReverse(TCharaChar)const

Parameters

TChar aChar

LocateReverseF(TChar)

IMPORT_C TIntLocateReverseF(TCharaChar)const

Parameters

TChar aChar

Match(const TDesC16 &)

IMPORT_C TIntMatch(const TDesC16 &aDes)const

Parameters

const TDesC16 & aDes

MatchC(const TDesC16 &)

IMPORT_C TIntMatchC(const TDesC16 &aDes)const

Parameters

const TDesC16 & aDes

MatchC(const TDesC16 &, TInt, TInt, TInt, TInt, const TCollationMethod *)

IMPORT_C TIntMatchC(const TDesC16 &aPattern,
TIntaWildChar,
TIntaWildSequenceChar,
TIntaEscapeChar,
TIntaMaxLevel = 3,
const TCollationMethod *aCollationMethod = NULL
)const

Parameters

const TDesC16 & aPattern
TInt aWildChar
TInt aWildSequenceChar
TInt aEscapeChar
TInt aMaxLevel = 3
const TCollationMethod * aCollationMethod = NULL

MatchC(const TDesC16 &, const TCollationMethod *, TInt, TInt, TInt, TInt)

IMPORT_C TIntMatchC(const TDesC16 &aPattern,
const TCollationMethod *aCollationMethod,
TIntaMaxLevel = 3,
TIntaWildChar = '?',
TIntaWildSequenceChar = '*',
TIntaEscapeChar = 0
)const

Parameters

const TDesC16 & aPattern
const TCollationMethod * aCollationMethod
TInt aMaxLevel = 3
TInt aWildChar = '?'
TInt aWildSequenceChar = '*'
TInt aEscapeChar = 0

MatchF(const TDesC16 &)

IMPORT_C TIntMatchF(const TDesC16 &aDes)const

Parameters

const TDesC16 & aDes

Mid(TInt)

IMPORT_C TPtrC16Mid(TIntaPos)const

Parameters

TInt aPos

Mid(TInt, TInt)

IMPORT_C TPtrC16Mid(TIntaPos,
TIntaLength
)const

Parameters

TInt aPos
TInt aLength

Ptr()

IMPORT_C const TUint16 *Ptr()const

Right(TInt)

IMPORT_C TPtrC16Right(TIntaLength)const

Parameters

TInt aLength

Size()

TInt Size()const [inline]

Gets the size of the data.

This is the number of bytes occupied by the data represented by the descriptor.

The size of the data represented by the descriptor. This is always twice the length.

Type()

TInt Type()const [protected, inline]

operator!=(const TDesC16 &)

TBool operator!=(const TDesC16 &aDes)const [inline]

Determines whether this descriptor's data is not equal to the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if not equal, false otherwise.

TDesC16::Compare

Parameters

const TDesC16 & aDesThe 16-bit non-modifiable descriptor whose data is to be compared with this descriptor's data.

operator<(const TDesC16 &)

TBool operator<(const TDesC16 &aDes)const [inline]

Determines whether this descriptor's data is less than the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if less than, false otherwise.

TDesC16::Compare

Parameters

const TDesC16 & aDesThe 16-bit non-modifable descriptor whose data is to be compared with this descriptor's data.

operator<=(const TDesC16 &)

TBool operator<=(const TDesC16 &aDes)const [inline]

Determines whether this descriptor's data is less than or equal to the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if less than or equal, false otherwise.

TDesC16::Compare

Parameters

const TDesC16 & aDesThe 16-bit non- modifiable descriptor whose data is to be compared with this descriptor's data.

operator==(const TDesC16 &)

TBool operator==(const TDesC16 &aDes)const [inline]

Determines whether this descriptor's data is equal to the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if equal, false otherwise.

TDesC16::Compare

Parameters

const TDesC16 & aDesThe 16-bit non-modifiable descriptor whose data is to be compared with this descriptor's data.

operator>(const TDesC16 &)

TBool operator>(const TDesC16 &aDes)const [inline]

Determines whether this descriptor's data is greater than the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if greater than, false otherwise.

TDesC16::Compare

Parameters

const TDesC16 & aDesThe 16-bit non-modifiable descriptor whose data is to be compared with this descriptor's data.

operator>=(const TDesC16 &)

TBool operator>=(const TDesC16 &aDes)const [inline]

Determines whether this descriptor's data is greater than or equal to the specified descriptor's data.

The comparison is implemented using the Compare() member function.

True if greater than or equal, false otherwise.

TDesC16::Compare

Parameters

const TDesC16 & aDesThe 16-bit non-modifiable descriptor whose data is to be compared with this descriptor's data.

operator[](TInt)

const TUint16 &operator[](TIntanIndex)const [inline]

Gets a reference to a single data item within this descriptor's data.

A reference to the data item.

panic

USER 9, if anIndex is negative or greater than or equal to the current length of the descriptor.

Parameters

TInt anIndexThe position of the individual data item within the descriptor's data. This is an offset value; a zero value refers to the leftmost data position.

Member Enumerations Documentation

Enum TPrefix

A value returned by a call to HasPrefixC().

TDesC16::HasPrefixC

Enumerators

EIsPrefix = 0

Indicates that a supplied prefix can be extended to be equivalent to the text at the start of a descriptor.

EMightBePrefix = 1

Indicates that a supplied prefix does not seem to be a prefix, but it is possible that it could be extended to become equivalent to text at the start of this descriptor.

EIsNotPrefix = 2

Indicates that a supplied prefix cannot be extended to be equivalent to the text at the start of a descriptor.

Member Data Documentation

__DECLARE_TEST

__DECLARE_TEST[private]

TUint iLength

TUint iLength[private]