class CDesC16Array : public CArrayFixBase |
An implementation base class for 16 bit descriptor arrays. It provides some of the behaviour for 16 bit descriptor arrays.
Public Member Functions | |
---|---|
~CDesC16Array() | |
IMPORT_C void | AppendL(const TDesC16 &) |
IMPORT_C void | Delete(TInt) |
IMPORT_C void | Delete(TInt, TInt) |
IMPORT_C TInt | Find(const TDesC16 &, TInt &, TKeyCmpText) |
IMPORT_C TInt | FindIsq(const TDesC16 &, TInt &, TKeyCmpText) |
IMPORT_C TInt | InsertIsqAllowDuplicatesL(const TDesC16 &, TKeyCmpText) |
IMPORT_C TInt | InsertIsqL(const TDesC16 &, TKeyCmpText) |
IMPORT_C void | InsertL(TInt, const TDesC16 &) |
IMPORT_C TInt | MdcaCount() |
IMPORT_C TPtrC16 | MdcaPoint(TInt) |
IMPORT_C void | Reset() |
IMPORT_C void | Sort(TKeyCmpText) |
TPtrC16 | operator[](TInt) |
Protected Member Functions | |
---|---|
CDesC16Array(TBufRep, TInt) |
IMPORT_C | ~CDesC16Array | ( | ) |
Frees all resources owned by the object, prior to its destruction. In particular, it deletes all descriptors from the array and frees the memory allocated to the array buffer.
IMPORT_C void | AppendL | ( | const TDesC16 & | aPtr | ) |
Appends a descriptor onto the end of any existing descriptor elements in the array.
const TDesC16 & aPtr | A reference to the descriptor to be appended to the array. |
IMPORT_C void | Delete | ( | TInt | aIndex, |
TInt | aCount | |||
) |
Deletes one or more logically contiguous descriptor elements from the array.
The deletion starts at the specified position.Deleting descriptor elements from the array frees the memory occupied by the associated heap descriptors and removes their pointers from the array buffer but does not cause the array buffer to be automatically compressed. Call the Compress() function to return excess space in the array buffer to the heap.
IMPORT_C TInt | Find | ( | const TDesC16 & | aPtr, |
TInt & | aPos, | |||
TKeyCmpText | aTextComparisonType = ECmpFolded | |||
) | const |
Finds the position of a descriptor element within the array which matches the specified descriptor, using a sequential search.
The array is searched sequentially for a matching descriptor element, starting with the first descriptor element in the array. Descriptors are compared using one of the TDesC comparison functions. The enumeration aTextComparisonType governs how the descriptors are to be compared.
Where an array has duplicate descriptor elements, the function only supplies the position of the first descriptor element.
const TDesC16 & aPtr | A reference to a descriptor to be used for comparison. |
TInt & aPos | If the descriptor element is found, this reference is set to the position of that descriptor element within the array. The position is relative to zero, (i.e. the first descriptor element in the array is at position 0). If the descriptor element is not found and the array is not empty, then the value of the reference is set to the number of descriptor elements in the array. If the descriptor element is not found and the array is empty, then the reference is set to zero. |
TKeyCmpText aTextComparisonType = ECmpFolded | An enumeration which determines the type of comparison to be made between descriptors. If no parameter is explicitly passed,ECmpFolded is used by default. |
IMPORT_C TInt | FindIsq | ( | const TDesC16 & | aPtr, |
TInt & | aPos, | |||
TKeyCmpText | aTextComparisonType = ECmpFolded | |||
) | const |
Finds the position of a descriptor element within the array which matches the specified descriptor, using a binary search technique. The array must be in sequence, otherwise the outcome is unpredictable.
Descriptors are compared using one of the TDesC comparison functions. The enumeration aTextComparisonType governs how the descriptors are to be compared.
Where an array has duplicate descriptor elements, the function cannot guarantee which matching descriptor element it will return; except that it will find one of them.
const TDesC16 & aPtr | A reference to a descriptor to be used for comparison. |
TInt & aPos | If the descriptor element is found, the reference is set to the position of that descriptor element within the array. The position is relative to zero, (i.e. the first descriptor element in the array is at position 0). If the descriptor element is not found and the array is not empty, then the reference is set to the position of the first descriptor element in the array whose content is greater than the content of aPtr. If the descriptor element is not found and the array is empty, then the reference is set to zero. |
TKeyCmpText aTextComparisonType = ECmpFolded | An enumeration which determines the type of comparison to be made between descriptors. If no parameter is explicitly passed, ECmpFolded is used by default. |
IMPORT_C TInt | InsertIsqAllowDuplicatesL | ( | const TDesC16 & | aPtr, |
TKeyCmpText | aTextComparisonType = ECmpFolded | |||
) |
Inserts a descriptor into the array at a position which maintains the sequence of the descriptors; allows duplicates.
The sequence is determined by comparing descriptors using one of the TDesC comparison functions. The enumeration aTextComparisonType governs how the descriptors are to be compared.
The array should already be in sequence, otherwise the position of the new descriptor element is unpredictable. Descriptor elements which are the same are permitted; if the descriptor aPtr is a duplicate of an existing descriptor within the array, then the new descriptor element is positioned after the existing descriptor element.
const TDesC16 & aPtr | A reference to the descriptor to be inserted into the array. |
TKeyCmpText aTextComparisonType = ECmpFolded | An enumeration which determines the type of comparison to be made between descriptors for the purpose of choosing the insertion position. If no parameter is explicitly passed, ECmpFolded is used by default. |
IMPORT_C TInt | InsertIsqL | ( | const TDesC16 & | aPtr, |
TKeyCmpText | aTextComparisonType = ECmpFolded | |||
) |
Inserts a descriptor into the array at a position which maintains the sequence of the descriptors.
The sequence is determined by comparing descriptors using one of the TDesC comparison functions. The enumeration aTextComparisonType governs how the descriptors are to be compared.
The array should already be in sequence, otherwise the position of the new descriptor element is unpredictable. Descriptor elements which are the same are not permitted.
const TDesC16 & aPtr | A reference to the descriptor to be inserted into the array. |
TKeyCmpText aTextComparisonType = ECmpFolded | An enumeration which determines the type of comparison to be made between descriptors for the purpose of choosing the insertion position. If no parameter is explicitly passed, ECmpFolded is used by default. |
IMPORT_C void | InsertL | ( | TInt | aPos, |
const TDesC16 & | aPtr | |||
) |
Inserts a descriptor into the array at the specified position.
If the specified position is the same as the current number of descriptor elements in the array, this has the effect of appending the element.
TInt aPos | The position within the array where the descriptor element is to be inserted. The position is relative to zero, i.e. zero implies the first descriptor element. This value must not be negative and must not be greater than the number of descriptor elements currently in the array, otherwise the function raises an E32USER-CBase 21 panic. |
const TDesC16 & aPtr | The descriptor to be inserted into the array. |
IMPORT_C TInt | MdcaCount | ( | ) | const |
Returns the number of descriptor elements in the array. The function implements the function interface MDesC16Array::MdcaCount().
IMPORT_C TPtrC16 | MdcaPoint | ( | TInt | aIndex | ) | const |
Indexes into a descriptor array. The function implements the interface MDesC16Array::MdcaPoint().
TInt aIndex | The position of the descriptor element within the array. The position is relative to zero; i.e. zero implies the first descriptor element in the array. This value must be non-negative and less than the number of descriptors currently within the array otherwise the operator panics with EArrayIndexOutOfRange. |
IMPORT_C void | Reset | ( | ) |
Deletes all descriptors from the array and frees the memory allocated to the array buffer.
IMPORT_C void | Sort | ( | TKeyCmpText | aTextComparisonType = ECmpFolded | ) |
Sorts the descriptor elements into sequence.
The sequence is determined by comparing descriptors using one of the member functions of the descriptor base class TDesC.
TKeyCmpText aTextComparisonType = ECmpFolded | An enumeration which defines the type of comparison to be made between descriptors. By default the comparison type is ECmpFolded. |
TPtrC16 | operator[] | ( | TInt | aIndex | ) | const [inline] |
Returns a non-modifiable descriptor to represent the descriptor element located at the specified index within the array.
TInt aIndex | The position of the descriptor element within the array. The position is relative to zero; i.e. zero implies the first descriptor element in the array. This value must be non-negative and less than the number of descriptors currently within the array otherwise the operator panics with EArrayIndexOutOfRange |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.