Foxit PDF SDK
|
Public Types | |
enum | ErrorType { invalidArraySize, memoryAllocationError, indexOutOfRange } |
Enumeration for error type. More... | |
Public Member Functions | |
CFX_ArrayTemplate (IFX_Allocator *pAllocator=0) | |
Constructor, from an allocator. More... | |
CFX_ArrayTemplate (const CFX_ArrayTemplate &other, IFX_Allocator *pAllocator=0) | |
The copy constructor. More... | |
FX_BOOL | Add (TYPE newElement) |
Add an element at the tail. Potentially growing the array. More... | |
TYPE * | AddSpace () |
Add an element's space. More... | |
FX_BOOL | Append (const CFX_ArrayTemplate &src) |
Append an array. More... | |
FX_BOOL | Copy (const CFX_ArrayTemplate &src) |
Copy from an array. More... | |
TYPE & | ElementAt (int nIndex) |
This method retrieves a ref to an element specified by an index number. More... | |
int | Find (const TYPE &data, int iStart=0) const |
Find an element from specified position to last. More... | |
void | FX_Error (ErrorType error, FX_INT32 badIndex=0) const |
The function is called when raise a fatal error.Print error info an exit(1). More... | |
const TYPE | GetAt (int nIndex) const |
This method retrieves an element specified by an index number. More... | |
const TYPE * | GetData () const |
Direct Access to the element data (may return NULL). More... | |
TYPE * | GetData () |
Direct Access to the element data (may return NULL). More... | |
TYPE * | GetDataPtr (int index) |
Get a pointer to the specified element in the array. Direct pointer access. More... | |
int | GetSize () const |
Get the number of elements in the array. More... | |
int | GetUpperBound () const |
Get the upper bound in the array, actually the maximum valid index. More... | |
FX_BOOL | InsertAt (int nIndex, TYPE newElement, int nCount=1) |
Inset one or more continuous element at specified position. More... | |
FX_BOOL | InsertAt (int nStartIndex, const CFX_BasicArray *pNewArray) |
Inset an array at specified position. More... | |
TYPE * | InsertSpaceAt (int nIndex, int nCount) |
Insert a number of elements. More... | |
CFX_ArrayTemplate & | operator= (const CFX_ArrayTemplate &src) |
Assignment operator overload. More... | |
const TYPE | operator[] (int nIndex) const |
Subscript([]) operator overload. It retrieves a element specified by the zero-based index in nIndex. More... | |
TYPE & | operator[] (int nIndex) |
Subscript([]) operator overload. This function returns a reference to the specified element specified by the zero-based index in nIndex. More... | |
void | RemoveAll () |
Clean up the array. More... | |
FX_BOOL | RemoveAt (int nIndex, int nCount=1) |
Remove a number of elements at specified position. More... | |
FX_BOOL | SetAt (int nIndex, TYPE newElement) |
This method overwrites an element specified by an index number. More... | |
FX_BOOL | SetAtGrow (int nIndex, TYPE newElement) |
Set an element value at specified position. Potentially growing the array. More... | |
FX_BOOL | SetSize (int nNewSize, int nGrowBy=-1) |
Change the allocated size and the grow amount. More... | |
Additional Inherited Members | |
![]() | |
IFX_Allocator * | m_pAllocator |
Special allocator pointer. NULL to use default allocator. | |
The class represents array template. Total allocated size is limited to 2^28 bytes (256MB).
enum CFX_ArrayTemplate::ErrorType |
|
inline |
Constructor, from an allocator.
[in] | pAllocator | An allocator. Default value: NULL. |
|
inline |
The copy constructor.
[in] | other | The other array template object. |
[in] | pAllocator | An allocator. Default value: NULL. |
|
inline |
Add an element at the tail. Potentially growing the array.
[in] | newElement | The input element. |
|
inline |
Add an element's space.
|
inline |
Append an array.
[in] | src | The input array. |
|
inline |
Copy from an array.
[in] | src | The input array. |
|
inline |
This method retrieves a ref to an element specified by an index number.
[in] | nIndex | Specifies the zero-based index of the element. |
|
inline |
Find an element from specified position to last.
[in] | data | The input element. |
[in] | iStart | Specifies the zero-based index of start element to find. |
|
inline |
The function is called when raise a fatal error.Print error info an exit(1).
[in] | error | The error type. It should be one of following values: CFX_ArrayTemplate::invalidArraySize, CFX_ArrayTemplate::memoryAllocationError. |
[in] | badIndex | The bad index. Default value: 0 |
|
inline |
This method retrieves an element specified by an index number.
[in] | nIndex | Specifies the zero-based index of the element. |
|
inline |
Direct Access to the element data (may return NULL).
|
inline |
Direct Access to the element data (may return NULL).
|
inline |
Get a pointer to the specified element in the array. Direct pointer access.
[in] | index | Specifies the zero-based index of element in the array. |
|
inline |
Get the number of elements in the array.
|
inline |
Get the upper bound in the array, actually the maximum valid index.
|
inline |
Inset one or more continuous element at specified position.
[in] | nIndex | Specifies the zero-based index in the array. |
[in] | newElement | Specifies the element value to insert. |
[in] | nCount | Specifies the count of the element to insert. |
|
inline |
Inset an array at specified position.
[in] | nStartIndex | Specifies the zero-based index of start element to insert at. |
[in] | pNewArray | The input array. |
|
inline |
Insert a number of elements.
[in] | nIndex | Specifies the zero-based index of start element in the array. |
[in] | nCount | Specifies the count of elements to insert. |
|
inline |
Assignment operator overload.
[in] | src | The input array. |
|
inline |
Subscript([]) operator overload. It retrieves a element specified by the zero-based index in nIndex.
[in] | nIndex | Specifies the zero-based index in the array. |
|
inline |
Subscript([]) operator overload. This function returns a reference to the specified element specified by the zero-based index in nIndex.
[in] | nIndex | Specifies the zero-based index in the array. |
|
inline |
Clean up the array.
|
inline |
Remove a number of elements at specified position.
[in] | nIndex | Specifies the zero-based index in the array. |
[in] | nCount | Specifies the count of element to remove. |
|
inline |
This method overwrites an element specified by an index number.
[in] | nIndex | Specifies the zero-based index of the element. |
[in] | newElement | An element. |
|
inline |
Set an element value at specified position. Potentially growing the array.
[in] | nIndex | Specifies the zero-based index of element in the array. |
[in] | newElement | The input element. |
|
inline |
Change the allocated size and the grow amount.
[in] | nNewSize | The new size in elements expected. |
[in] | nGrowBy | The grow amount in elements expected. This can be -1 for the grow amount unchanged. |