Location:
e32des16.h
Link against: euser.lib
TDesC16
Supported from 5.0
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.
Defined in TDesC16
:
Alloc()
, AllocL()
, AllocLC()
, Compare()
, CompareC()
, CompareF()
, Find()
, FindC()
, FindF()
, Left()
, Length()
, Locate()
, LocateF()
, LocateReverse()
, LocateReverseF()
, Match()
, MatchC()
, MatchF()
, Mid()
, Ptr()
, Right()
, Size()
, operator!=()
, operator<()
, operator<=()
, operator==()
, operator>()
, operator>=()
, operator[]()
TInt Length() const;
Returns the length of the data.
This is the number of 16 bit values or data items represented by the descriptor.
|
TInt Size() const;
Returns the size of the data.
This is the number of bytes occupied by the data represented by the descriptor.
|
const TUint16* Ptr() const;
Returns a pointer to the data represented by the descriptor.
The data cannot be changed through the returned pointer.
|
TPtrC16 Left(TInt aLength) 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.
|
|
TPtrC16 Right(TInt aLength) 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.
|
|
TPtrC16 Mid(TInt aPos) const;
TPtrC16 Mid(TInt aPos,TInt aLength) 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. If identified by position alone, the implied length is the length of the remainder of the data starting from the specified position.
|
|
const TUint16& operator[](TInt anIndex) const;
Subscript operator.
Returns a reference to a single data item within this descriptor's data.
|
|
HBufC16* Alloc() const;
Creates an HBufC initialised with this descriptor data.
Creates a new 16 bit heap descriptor and initialises it with a copy of this descriptor's data.
|
HBufC16* AllocL() const;
Creates an HBufC initialised with this descriptor data; leaves on failure.
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.
|
HBufC16* AllocLC() const;
Creates an HBufC initialised with this descriptor data; leaves on failure; uses the cleanupstack.
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.
|
TInt Compare(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.
|
|
TInt CompareC(const TDesC16& aDes) const;
Compares data using the standard collation method.
Compares this descriptor's data with the specified descriptor's data using the standard collation method appropriate to the current locale.
|
|
TInt CompareC(const TDesC16& aDes, TInt aMaxLevel, const TCollationMethod* aCollationMethod) const;
Supported from 5.1
Compares data to the specified maximum collation level.
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.
|
|
TInt CompareC(const TDesC16& aDes, const TInt16* aCollationRules) const;
Withdrawn in 6.0
Compares data using a specified collation rule set.
[Use of this function is DEPRECATED from release 5.1].
Compares this descriptor's data with the specified descriptor's data using the specified collation rule set.
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.
|
|
TInt CompareC(const TDesC16& aDes,TUint32 aDesiredCollationRulesId,TUint32& aActualCollationRulesId) const;
Withdrawn in 6.0
Compares data using collation rule set identified by a UID.
[Use of this function is DEPRECATED from release 5.1].
Compares this descriptor's data with the specified descriptor's data using the collation rule set associated with the specified Uid. If no collation rule set with the specified Uid can be found, the function uses a default collation rule set and returns its associated Uid.
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.
|
|
TInt CompareF(const TDesC16& aDes) const;
Compares folded data.
Compares this descriptor's folded data with the specified descriptor's folded data. The function uses the standard folding method appropriate to the current locale.
|
|
TInt operator==(const TDesC16& aDes) const;
Determines whether this descriptor's data is equal to the specified descriptor's data.
The comparison is implemented using the Compare() member function.
|
|
TInt operator!=(const TDesC16& aDes) const;
Determines whether this descriptor's data is not equal to the specified descriptor's data.
The comparison is implemented using the Compare() member function.
|
|
TInt operator<(const TDesC16& aDes) const;
Determines whether this descriptor's data is less than the specified descriptor's data.
The comparison is implemented using the Compare() member function.
|
|
TInt operator<=(const TDesC16& aDes) const;
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.
|
|
TInt operator>(const TDesC16& aDes) const;
Determines whether this descriptor's data is greater than the specified descriptor's data.
The comparison is implemented using the Compare() member function.
|
|
TInt operator>=(const TDesC16& aDes) const;
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.
|
|
TInt Locate(TChar aChar) const;
Searches for a character in forwards direction.
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.
|
|
TInt LocateF(TChar aChar) const;
Searches for a character in forwards direction; folded.
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. The function uses the standard folding method appropriate to the current locale.
|
|
TInt LocateReverse(TChar aChar) const;
Searches for a character in backwards direction.
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.
|
|
TInt LocateReverseF(TChar aChar) const;
Searches for a character in backwards direction; folded.
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. The function uses the standard folding method appropriate to the current locale.
|
|
TInt Find(const TDesC16& aDes) const;
TInt Find(const TUint16* pS,TInt aLenS) const;
Finds data.
Searches for the first occurrence of the specified data sequence within this descriptor. Searching always starts at the beginning of this descriptor's data.
The search data can be defined within another descriptor or it may be defined as a pointer and length pair.
|
|
TInt FindC(const TDesC16& aDes) const;
TInt FindC(const TUint16* pS,TInt aLenS) const;
Finds data; collated.
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.
The search data can be defined within another descriptor or it may be defined as a pointer and length pair.
|
|
TInt FindF(const TDesC16& aDes) const;
TInt FindF(const TUint16* pS,TInt aLenS) const;
Finds data; folded.
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. The function uses the standard folding method appropriate to the current locale.
The search data can be defined within another descriptor or it may be defined as a pointer and length pair.
|
|
TInt Match(const TDesC16& aDes) const;
Pattern-matches data.
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.
|
|
TInt MatchC(const TDesC16& aDes) const;
Pattern-matches data; collated.
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.
|
|
TInt MatchF(const TDesC16& aDes) const;
Pattern-matches data; folded.
Searches this descriptor's folded data for a match with the folded match pattern supplied in the specified descriptor. The function uses the standard folding 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.
|
|