TDesC16 Class Reference

#include <e32des16.h>

class TDesC16
Public Member Enumerations
enumTPrefix { EIsPrefix, EMightBePrefix, EIsNotPrefix }
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 TIntFindCorruptSurrogate()
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 TIntLocate2(TChar)
IMPORT_C TIntLocateF(TChar)
IMPORT_C TIntLocateF2(TChar)
IMPORT_C TIntLocateReverse(TChar)
IMPORT_C TIntLocateReverse2(TChar)
IMPORT_C TIntLocateReverseF(TChar)
IMPORT_C TIntLocateReverseF2(TChar)
IMPORT_C TIntMatch(const TDesC16 &)
IMPORT_C TIntMatch2(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()

Detailed Description

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.

See also: TDesC TPtrC16

Member Enumeration Documentation

Enum TPrefix

A value returned by a call to HasPrefixC().

See also: TDesC16::HasPrefixC

EnumeratorValueDescription
EIsPrefix0

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

EMightBePrefix1

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.

EIsNotPrefix2

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

Constructor & Destructor Documentation

TDesC16 ( )

TDesC16()[protected, inline]

TDesC16 ( TInt, TInt )

TDesC16(TIntaType,
TIntaLength
)[protected, inline]

Member Function Documentation

Alloc ( )

IMPORT_C HBufC16 *Alloc()const

Creates a new 16-bit heap descriptor and initialises it with a copy of this descriptor's data.

Return Value
A pointer to the new 16-bit heap descriptor, if creation is successful. NULL, if creation of the descriptor fails.

AllocL ( )

IMPORT_C HBufC16 *AllocL()const

Creates a new 16-bit heap descriptor and initialises it with a copy of this descriptor's data.

The function leaves, if creation of the descriptor fails.

Return Value
A pointer to the 16-bit heap descriptor, if creation is successful.

AllocLC ( )

IMPORT_C HBufC16 *AllocLC()const

Creates a new 16-bit heap descriptor, initialises it with a copy of this descriptor's data, and puts a pointer to the descriptor onto the cleanup stack.

The function leaves, if creation of the descriptor fails.

Return Value
A pointer to the 16-bit heap descriptor, if creation is successful. The pointer is also put onto the cleanup stack.

AtC ( TInt )

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

Compare ( const TDesC16 & )

IMPORT_C TIntCompare(const TDesC16 &aDes)const

Compares this descriptor's data with the specified descriptor's data.

The comparison proceeds on a double-byte for double byte basis. The result of the comparison is based on the difference of the first pair of bytes to disagree.

Two descriptors are equal if they have the same length and content. Where two descriptors have different lengths and the shorter descriptor's data matches the first part of the longer descriptor's data, the shorter is considered to be less than the longer.

Parameters
aDesThe 16-bit non-modifable descriptor whose data is to be compared with this descriptor's data.
Return Value
Positive. if this descriptor is greater than the specified descriptor. Negative. if this descriptor is less than the specified descriptor. Zero, if both descriptors have the same length and the their contents are the same.

CompareC ( const TDesC16 & )

IMPORT_C TIntCompareC(const TDesC16 &aDes)const

Compares this descriptor's data with the specified descriptor's data using the standard collation method appropriate to the current locale.

See also: TDesC16::Compare()

Parameters
aDesThe 16-bit non-modifable descriptor whose data is to be compared with this descriptor's data.
Return Value
Positive, if this descriptor is greater than the specified descriptor. Negative, if this descriptor is less than the specified descriptor. Zero, if the content of both descriptors match.

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

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

Compares this descriptor's data with the specified descriptor's data to the specified maximum collation level and using the specified collation method.

If no collation method is supplied, a default method is used that uses a locale-independent collation table. This means that sorting and matching will not be based on the current locale.

This function is only defined for 16-bit (Unicode) build variants. This means that the function is not defined for 8-bit build variants, even when an explicit 16-bit descriptor is used.

Strings may match even if the lengths of their respective descriptors are different.

See also: Mem::CollationMethodByIndex() Mem::CollationMethodById() TDesC16::Compare()

Parameters
aDesThe 16-bit non-modifable descriptor whose data is to be compared with this descriptor's data.
aMaxLevelThe maximum collation level. This is an integer with values: 0, 1, 2 or 3, which, effectively, determines how 'tight' the matching should be. Level 3 is always used if the aim is to sort strings.
aCollationMethodA pointer to the collation method or NULL. Collation methods can be retrieved by calls to Mem::CollationMethodByIndex() and Mem::CollationMethodById(). Specifying NULL means that the default method is used.
Return Value
Positive, if this descriptor is greater than the specified descriptor. Negative, if this descriptor is less than the specified descriptor. Zero, if the content of both descriptors match.

CompareF ( const TDesC16 & )

IMPORT_C TIntCompareF(const TDesC16 &aDes)const

Compares this descriptor's folded data with the specified descriptor's folded data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for comparing strings in natural language; use CompareC() for this.

See also: TDesC16::Compare()

Parameters
aDesThe 16-bit non-modifable descriptor whose data is to be compared with this descriptor's data.
Return Value
Positive, if this descriptor is greater than the specified descriptor. Negative, if this descriptor is less than the specified descriptor. Zero, if both descriptors have the same length and the their contents are the same.

DoSetLength ( TInt )

voidDoSetLength(TIntaLength)[protected, inline]

Find ( const TDesC16 & )

IMPORT_C TIntFind(const TDesC16 &aDes)const

Searches for the first occurrence of the specified data sequence within this descriptor.

Searching always starts at the beginning of this descriptor's data.

Parameters
aDesThe 16-bit non-modifiable descriptor containing the data sequence to be searched for.
Return Value
The offset of the data sequence from the beginning of this descriptor's data. KErrNotFound, if the data sequence cannot be found.

Find ( const TUint16 *, TInt )

IMPORT_C TIntFind(const TUint16 *aBuf,
TIntaLen
)const

Searches for the first occurrence of the specified data sequence within this descriptor.

Searching always starts at the beginning of this descriptor's data.

Parameters
aBufA pointer to a location containing the data sequence to be searched for.
aLenThe length of the data sequence to be searched for. This value must not be negative, otherwise the function raises a panic.
Return Value
The offset of the data sequence from the beginning of this descriptor's data. KErrNotFound, if the data sequence cannot be found.
Panic Codes
USER17 if aLenS is negative.

FindC ( const TDesC16 & )

IMPORT_C TIntFindC(const TDesC16 &aDes)const

Searches for the first occurrence of the specified collated data sequence within this descriptor's collated data.

Searching always starts at the beginning of this descriptor's data. The function uses the standard collation method appropriate to the current locale.

Parameters
aDesThe 16-bit non-modifable descriptor containing the data sequence to be searched for.
Return Value
The offset of the data sequence from the beginning of this descriptor's data. KErrNotFound, if the data sequence cannot be found.

FindC ( const TUint16 *, TInt )

IMPORT_C TIntFindC(const TUint16 *aBuf,
TIntaLen
)const

Searches for the first occurrence of the specified collated data sequence within this descriptor's collated data.

Searching always starts at the beginning of this descriptor's data. The function uses the standard collation method appropriate to the current locale.

Parameters
aBufA pointer to a location containing the data sequence to be searched for.
aLenThe length of the data sequence to be searched for.
Return Value
The offset of the data sequence from the beginning of this descriptor's data. KErrNotFound, if the data sequence cannot be found.
Panic Codes
USER17 if aLength is negative.

FindC ( const TUint16 *, TInt, TInt )

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

Searches for the first occurrence of the specified collated data sequence within this descriptor's collated data to the specified maximum collation level.

Parameters
aTextA pointer to a location containing the data sequence to be searched for.
aLengthThe length of the data sequence to be searched for.
aMaxLevelThe maximum collation level. This is an integer with values: 0, 1, 2 or 3, which, effectively, determines how 'tight' the matching should be. Level 3 is always used if the aim is to sort strings.
Return Value
The offset of the data sequence from the beginning of this descriptor's data. KErrNotFound, if the data sequence cannot be found.

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

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

Searches for the first occurrence of the specified collated data sequence within this descriptor's collated data.

Searching always starts at the beginning of this descriptor's data. The function uses the standard collation method appropriate to the current locale.

Parameters
aDesThe 16-bit non-modifable descriptor containing the data sequence to be searched for.
aLengthFoundA refernce to the maximal length of the match found in the candidate string. KErrNotFound, if the data sequence cannot be found.
aMaxLevelThe maximum collation level. This is an integer with values: 0, 1, 2 or 3, which, effectively, determines how 'tight' the matching should be. Level 3 is always used if the aim is to sort strings.
Return Value
The offset of the data sequence from the beginning of this descriptor's data. KErrNotFound, if the data sequence cannot be found.

FindCorruptSurrogate ( )

IMPORT_C TIntFindCorruptSurrogate()const

Look for the first corrupt surrogate in the descriptor.

Return Value
The 16-bit position of the first corrupt surrogate. KErrNotFound, if not found.

FindF ( const TDesC16 & )

IMPORT_C TIntFindF(const TDesC16 &aDes)const

Searches for the first occurrence of the specified folded data sequence within this descriptor's folded data.

Searching always starts at the beginning of this descriptor's data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for finding strings in natural language; use FindC() for this.

See also: TDesC16::FindC()

Parameters
aDesThe 16-bit non-modifable descriptor containing the data sequence to be searched for.
Return Value
The offset of the data sequence from the beginning of this descriptor's data. KErrNotFound, if the data sequence cannot be found. Zero, if the length of the search data sequence is zero.

FindF ( const TUint16 *, TInt )

IMPORT_C TIntFindF(const TUint16 *aBuf,
TIntaLen
)const

Searches for the first occurrence of the specified folded data sequence within this descriptor's folded data.

Searching always starts at the beginning of this descriptor's data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for finding strings in natural language; use FindC() for this.

See also: TDesC16::FindC()

Parameters
aBufA pointer to a location containing the data sequence to be searched for.
aLenThe length of the data sequence to be searched for. This value must not be negative, otherwise the function raises a panic.
Return Value
The offset of the data sequence from the beginning of this descriptor's data. KErrNotFound, if the data sequence cannot be found. Zero, if the length of the search data sequence is zero.
Panic Codes
USER17 if aLenS is negative

GetCollationKeysL ( TInt, const TCollationMethod * )

IMPORT_C HBufC8 *GetCollationKeysL(TIntaMaxLevel,
const TCollationMethod *aCollationMethod
)const
Get the collation keys of this 16 bit descriptor for a given collation level If no collation method is supplied, a default method is used that uses a locale-independent collation table.
Parameters
aMaxLevelThe maximum collation level. This is an integer with values: 0, 1, 2 or 3. Level 3 is always used if the aim is to sort strings.
aCollationMethodA pointer to the collation method or NULL. Collation methods can be retrieved by calls to Mem::CollationMethodByIndex() and Mem::CollationMethodById(). Specifying NULL means that the default method is used.
Return Value
A pointer to the 8-bit heap buffer containing the collation keys if creation is succesful
Leave Codes
KErrNoMemoryif not enough memory to construct the output buffer

GetFoldedDecomposedFormL ( )

IMPORT_C HBufC16 *GetFoldedDecomposedFormL()const
Get the folded decomposed form of this 16 bit descriptor
Return Value
A pointer to the 16-bit heap buffer containing folded decomposed form if creation is succesful
Leave Codes
KErrNoMemoryif not enough memory to construct the output buffer

GetNormalizedDecomposedFormL ( )

IMPORT_C HBufC16 *GetNormalizedDecomposedFormL()const
Get the normalized decomposed form of this 16 bit descriptor
Return Value
A pointer to the 16-bit heap buffer containing normalized decomposed form if creation is successful
Leave Codes
KErrNoMemoryif not enough memory to construct the output buffer

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

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

Compares aPossiblePrefix against the start of the descriptor, using a collated comparison.

0: Only check character identities.

1: Check accents as well.

2: Check case as well.

3: Check Unicode values.

Currently only level 0 is supported.

Parameters
aLevelThe maximum level at which to perform the collation.
aCollationMethodThe collation method to be used for the matching.
Return Value
EIsPrefix, if aPossiblePrefix can be extended to be equivalent to the text at the start of this descriptor. EIsNotPrefix if aPossiblePrefix cannot be extended to be equivalent to the text at the start of this descriptor. EMightBePrefix if it currently 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. EMightBePrefix is returned in cases where it would be expensive to determine for sure.

Left ( TInt )

IMPORT_C TPtrC16Left(TIntaLength)const

Extracts the leftmost part of the data.

The function does not cut or remove any data but constructs a non-modifiable pointer descriptor to represent the leftmost part of the data.

USER 10 if aLength is negative.

Parameters
aLengthThe length of the data to be extracted. If this value is greater than the length of the descriptor, the function extracts the whole of the descriptor.
Return Value
The 16-bit non-modifiable pointer descriptor representing the leftmost part of the data.

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.

Return Value
The length of the data represented by the descriptor.

Locate ( TChar )

IMPORT_C TIntLocate(TCharaChar)const

Searches for the first occurrence of a character within this descriptor's data.

The search starts at the beginning of the data, i.e. at the leftmost position.

Parameters
aCharThe character to be found.
Return Value
The offset of the character position from the beginning of the data. KErrNotFound, if no matching character can be found.

Locate2 ( TChar )

IMPORT_C TIntLocate2(TCharaChar)const

The surrogate aware version of Locate().

Searches for the first occurrence of a character within this descriptor's data.

The search starts at the beginning of the data, i.e. at the leftmost position.

See also: TDesC16::Locate()

Parameters
aCharThe Unicode character to be found. Can be inside or outside BMP.
Return Value
The offset of the character position from the beginning of the data. KErrNotFound, if no matching character can be found. KErrCorruptSurrogateFound, if meet corrupt surrogate in the searching.

LocateF ( TChar )

IMPORT_C TIntLocateF(TCharaChar)const

Searches for the first occurrence of a folded character within this descriptor's folded data.

The search starts at the beginning of the data, i.e. at the leftmost position.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for searching strings in natural language.

Parameters
aCharThe character to be found.
Return Value
The offset of the character position from the beginning of the data. KErrNotFound, if no matching character can be found.

LocateF2 ( TChar )

IMPORT_C TIntLocateF2(TCharaChar)const

The surrogate aware version of LocateF().

Searches for the first occurrence of a folded character within this descriptor's folded data.

The search starts at the beginning of the data, i.e. at the leftmost position.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for searching strings in natural language.

See also: TDesC16::LocateF()

Parameters
aCharThe Unicode character to be found. Can be inside or outside BMP.
Return Value
The offset of the character position from the beginning of the data. KErrNotFound, if no matching character can be found. KErrCorruptSurrogateFound, if meet corrupt surrogate in the searching.

LocateReverse ( TChar )

IMPORT_C TIntLocateReverse(TCharaChar)const

Searches for the first occurrence of a character within this descriptor's data, searching from the end of the data.

The search starts at the rightmost position.

Parameters
aCharThe character to be found.
Return Value
The offset of the character position from the beginning of the data. KErrNotFound, if no matching character can be found.

LocateReverse2 ( TChar )

IMPORT_C TIntLocateReverse2(TCharaChar)const

The surrogate aware version of LocateReverse().

Searches for the first occurrence of a character within this descriptor's data, searching from the end of the data.

The search starts at the rightmost position.

See also: TDesC16::LocateReverse()

Parameters
aCharThe Unicode character to be found. Can be inside or outside BMP.
Return Value
The offset of the character position from the beginning of the data. KErrNotFound, if no matching character can be found. KErrCorruptSurrogateFound, if meet corrupt surrogate in the searching.

LocateReverseF ( TChar )

IMPORT_C TIntLocateReverseF(TCharaChar)const

Searches for the first occurrence of a folded character within this descriptor's folded data, searching from the end of the data.

The search starts at the rightmost position.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for searching strings in natural language.

Parameters
aCharThe character to be found
Return Value
The offset of the character position from the beginning of the data. KErrNotFound, if no matching character can be found.

LocateReverseF2 ( TChar )

IMPORT_C TIntLocateReverseF2(TCharaChar)const

The surrogate aware version of LocateReverseF().

Searches for the first occurrence of a folded character within this descriptor's folded data, searching from the end of the data.

The search starts at the rightmost position.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for searching strings in natural language.

See also: TDesC16::LocateReverseF()

Parameters
aCharThe Unicode character to be found. Can be inside or outside BMP.
Return Value
The offset of the character position from the beginning of the data. KErrNotFound, if no matching character can be found. KErrCorruptSurrogateFound, if meet corrupt surrogate in the searching.

Match ( const TDesC16 & )

IMPORT_C TIntMatch(const TDesC16 &aDes)const

Searches this descriptor's data for a match with the match pattern supplied in the specified descriptor.

The match pattern can contain the wildcard characters "*" and "?", where "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character.

Note that there is no 'escape character', which means that it is not possible to match either the "*" character itself or the "?" character itself using this function.

Parameters
aDesA 16-bit non-modifable descriptor containing the match pattern.
Return Value
If a match is found, the offset within this descriptor's data where the match first occurs. KErrNotFound, if there is no match.

Match2 ( const TDesC16 & )

IMPORT_C TIntMatch2(const TDesC16 &aDes)const

The surrogate aware version of Match().

Searches this descriptor's data for a match with the match pattern supplied in the specified descriptor.

The match pattern can contain the wildcard characters "*" and "?", where "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character.

Note that there is no 'escape character', which means that it is not possible to match either the "*" character itself or the "?" character itself using this function.

See also: TDesC16::Match()

Parameters
aDesA 16-bit non-modifable descriptor containing the match pattern.
Return Value
If a match is found, the offset within this descriptor's data where the match first occurs. KErrNotFound, if there is no match. KErrCorruptSurrogateFound, if meet corrupt surrogate in the searching.

MatchC ( const TDesC16 & )

IMPORT_C TIntMatchC(const TDesC16 &aDes)const

Searches this descriptor's collated data for a match with the collated match pattern supplied in the specified descriptor.

The function uses the standard collation method appropriate to the current locale.

The match pattern can contain the wildcard characters "*" and "?", where "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character.

Note that there is no 'escape character', which means that it is not possible to match either the "*" character itself or the "?" character itself using this function.

Parameters
aDesA 16-bit non-modifable descriptor containing the match pattern.
Return Value
If a match is found, the offset within this descriptor's data where the match first occurs. KErrNotFound, if there is no match.

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

Searches this descriptor's collated data for a match with the collated match pattern supplied in the specified descriptor.

The function uses the standard collation method appropriate to the current locale.

The match pattern can contain the wildcard characters specified by aWildChar and aWildSequenceChar parameters, where aWildSequenceChar matches zero or more consecutive occurrences of any character and aWildChar matches a single occurrence of any character.

Parameters
aPatternA 16-bit non-modifable descriptor containing the match pattern.
aWildCharWild card character which may be specified for aSearchTerm.
aWildSequenceCharWild card sequence character which may be specified for aSearchTerm.
aEscapeCharThe escape character, or 0 if there is to be none. The escape character removes any special meaning from the subsequent character. For example, if the escape, wild card and wild sequence characters are \, ? And * respectively, the search term "\?\*\\" matches only the candidate string "?*\";
aMaxLevelDetermines the tightness of the collation. At level 0, only character identities are distinguished. At level 1 accents are distinguished as well. At level 2 case is distinguishes as well. At level 3 all valid different Unicode characters are considered different.
aCollationMethodA pointer to the collation method or NULL. Collation methods can be retrieved by calls to Mem::CollationMethodByIndex() and Mem::CollationMethodById(). Specifying NULL means that the default method is used.
Return Value
If a match is found, the offset within this descriptor's data where the match first occurs. KErrNotFound, if there is no match.

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

Searches this descriptor's collated data for a match with the collated match pattern supplied in the specified descriptor.

The function uses the standard collation method appropriate to the current locale.

The match pattern can contain the wildcard characters specified by aWildChar and aWildSequenceChar parameters, where aWildSequenceChar matches zero or more consecutive occurrences of any character and aWildChar matches a single occurrence of any character.

See also: TCollationFlag

See also: TCollationMethod

Parameters
aPatternA 16-bit non-modifable descriptor containing the match pattern.
aCollationMethodA pointer to the collation method. Collation methods can be retrieved by calls to Mem::CollationMethodByIndex(), Mem::CollationMethodById() or by custom defined name. Flags can be set on definition of the custom TCollationMethod, or by const_cast-ing the returned pointer and setting the iFlags field directly.
aMaxLevelDetermines the tightness of the collation. Defaulted to 3 if omitted. At level 0, only character identities are distinguished. At level 1 accents are distinguished as well. At level 2 case is distinguishes as well. At level 3 all valid different Unicode characters are considered different.
aWildCharWild card character which may be specified for aSearchTerm. Defaulted to '?' if omitted.
aWildSequenceCharWild card sequence character which may be specified for aSearchTerm. Defaulted to '*' if omitted.
aEscapeCharThe escape character, or 0 if there is to be none. The escape character removes any special meaning from the subsequent character. For example, if the escape, wild card and wild sequence characters are \, ? And * respectively, the search term "\?\*\\" matches only the candidate string "?*\". Defaulted to 0 if omitted.
Return Value
If a match is found, the offset within this descriptor's data where the match first occurs. KErrNotFound, if there is no match.

MatchF ( const TDesC16 & )

IMPORT_C TIntMatchF(const TDesC16 &aDes)const

Searches this descriptor's folded data for a match with the folded match pattern supplied in the specified descriptor.

The match pattern can contain the wildcard characters "*" and "?", where "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for matching strings in natural language; use MatchC() for this.

Note that there is no 'escape character', which means that it is not possible to match either the "*" character itself or the "?" character itself using this function.

See also: TDesC16::MatchC()

Parameters
aDesA 16-bit non-modifable descriptor containing the match pattern.
Return Value
If a match is found, the offset within this descriptor's data where the match first occurs. KErrNotFound, if there is no match.

Mid ( TInt )

IMPORT_C TPtrC16Mid(TIntaPos)const

Extracts a portion of the data.

The function does not cut or remove any data but constructs a non-modifiable pointer descriptor to represent the defined portion.

The portion is identified by its starting position and by the length of the remainder of the data starting from the specified position.

USER 10 if aPos is negative or aPos is greater than the length of the descriptor.

Parameters
aPosThe starting position of the data to be extracted. This is an offset value; a zero value refers to the leftmost data position.
Return Value
The 16-bit non-modifiable pointer descriptor representing the specified portion of the data.

Mid ( TInt, TInt )

IMPORT_C TPtrC16Mid(TIntaPos,
TIntaLength
)const

Extracts a portion of the data.

The function does not cut or remove any data but constructs a non-modifiable pointer descriptor to represent the defined portion.

The portion is identified by its starting position and by its length.

USER 10 if aPos is negative or aPos plus aLength is greater than the length of the descriptor.

Parameters
aPosThe starting position of the data to be extracted. This is an offset value; a zero value refers to the leftmost data position.
aLengthThe length of data to be extracted.
Return Value
The 16-bit non-modifiable pointer descriptor representing the specified portion of the data.

Ptr ( )

IMPORT_C const TUint16 *Ptr()const

Gets a pointer to the data represented by the descriptor.

The data cannot be changed through the returned pointer.

Return Value
A pointer to the data

Right ( TInt )

IMPORT_C TPtrC16Right(TIntaLength)const

Extracts the rightmost part of the data.

The function does not cut or remove any data but constructs a non-modifiable pointer descriptor to represent the rightmost part of the data.

USER 10 if aLength is negative.

Parameters
aLengthThe length of data to be extracted. If this value is greater than the length of the descriptor, the function extracts the whole of the descriptor.
Return Value
The 16-bit non-modifiable pointer descriptor representing the rightmost part of the data.

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.

Return Value
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.

See also: TDesC16::Compare

Parameters
aDesThe 16-bit non-modifiable descriptor whose data is to be compared with this descriptor's data.
Return Value
True if not equal, false otherwise.

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.

See also: TDesC16::Compare

Parameters
aDesThe 16-bit non-modifable descriptor whose data is to be compared with this descriptor's data.
Return Value
True if less than, false otherwise.

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.

See also: TDesC16::Compare

Parameters
aDesThe 16-bit non- modifiable descriptor whose data is to be compared with this descriptor's data.
Return Value
True if less than or equal, false otherwise.

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.

See also: TDesC16::Compare

Parameters
aDesThe 16-bit non-modifiable descriptor whose data is to be compared with this descriptor's data.
Return Value
True if equal, false otherwise.

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.

See also: TDesC16::Compare

Parameters
aDesThe 16-bit non-modifiable descriptor whose data is to be compared with this descriptor's data.
Return Value
True if greater than, false otherwise.

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.

See also: TDesC16::Compare

Parameters
aDesThe 16-bit non-modifiable descriptor whose data is to be compared with this descriptor's data.
Return Value
True if greater than or equal, false otherwise.

operator[] ( TInt )

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

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

Parameters
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.
Return Value
A reference to the data item.
Panic Codes
USER9, if anIndex is negative or greater than or equal to the current length of the descriptor.