TDesC Methods
All descriptors are derived from the abstract base class TDesC which provides the following methods for accessing the data but doesn't provide any methods for altering the descriptor contents.
|
Name |
Description |
|
Alloc ( ) AllocL() AllocLC() |
Creates and returns an HBufC* initialized with a copy of the descriptor's data. |
|
Compare() CompareF() CompareC() |
Compares the descriptor's data with a supplied descriptor. |
|
Find() FindC() FindF() |
Searches for the first occurrence of a specified data sequence, with the search beginning at the start of the descriptor. |
|
Name |
Description |
|
HasPrefixC() |
Compares a possible prefix against the start of the descriptor, using a collated comparison. |
|
Left() |
Returns a TPtrC representing the leftmost n characters. |
|
Length() |
Returns the length of the data. Do not confuse it with Size (). For narrow descriptors, they return the same value; for wide descriptors, the size is twice the length. |
|
Locate() LocateF() LocateReverse() LocateReverseF() |
Searches for the first occurrence of a character within the descriptor's data, starting the search from the leftmost or rightmost position. |
|
Match() MatchC() MatchF() |
Searches the descriptor's data for a match with a match pattern supplied in the specified descriptor. |
|
Mid () |
Returns a TPtrC representing the middle n characters from position m. |
|
operator<() operator<=() operator»() operator>=() operator==() operator!=() |
Returns a TBool indicating the result of the comparison between the descriptor and a specified descriptor. |
|
operator[] () |
Returns a const TUint& to a specified single data item within the descriptor data. Iterating over a descriptor using operator [ ] is expensive; consider using C++ pointer arithmetic and the TDesC : : Ptr () function instead. |
|
Name |
Description |
|
Ptr ( ) |
Returns a const TUint* to the data represented by the descriptor. |
|
Right() |
Returns a TPtrC representing the rightmost n characters. |
|
Size() |
Returns the size of the data in bytes; do not confuse it with Length ( ). |
Post a comment