csStringArray Class Reference
An array of strings. More...
#include <stringarray.h>
Inheritance diagram for csStringArray:

Public Methods | |
csStringArray (int ilimit=0, int ithreshold=0) | |
Initialize object to hold initially 'ilimit' elements, and increase storage by 'ithreshold' each time the upper bound is exceeded. | |
void | Sort (ArraySortCompareFunction *compare) |
Sort array based on case sensitive string compare function. | |
void | Sort () |
Sort array based on case sensitive string compare function. | |
int | FindSortedKey (void *key, ArrayCompareKeyFunction *comparekey=CaseSensitiveCompareKey, int *candidate=0) const |
Find an element based on some key, using a csArrayCompareKeyFunction. | |
char * | Pop () |
Pop an element from tail end of array. | |
int | Find (const char *what) const |
Find a string, case-sensitive. | |
int | FindCaseInsensitive (const char *what) const |
Find a string, case-insensitive. | |
int | InsertSorted (const char *const &newstr, ArrayCompareFunction *compare=CaseSensitiveCompare, int *equal_index=0) |
Insert a string element at a sorted position, using a specialized csArrayCompareFunction. |
Detailed Description
An array of strings.This array will properly make copies of the strings and delete those copies using delete[] later.
Definition at line 50 of file stringarray.h.
Constructor & Destructor Documentation
|
Initialize object to hold initially 'ilimit' elements, and increase storage by 'ithreshold' each time the upper bound is exceeded.
Definition at line 58 of file stringarray.h. |
Member Function Documentation
|
Find a string, case-sensitive. Returns -1 if not found, else item index. Works with unsorted arrays. For sorted arrays, FindSortedKey() is faster. Definition at line 139 of file stringarray.h. References csArray< const char *, csStringArrayElementHandler >::Get(), and csArray< const char *, csStringArrayElementHandler >::Length(). Referenced by scfStringArray::Find(). |
|
Find a string, case-insensitive. Returns -1 if not found, else item index. Works with unsorted arrays. For sorted arrays, FindSortedKey() is faster. Definition at line 151 of file stringarray.h. References csArray< const char *, csStringArrayElementHandler >::Get(), and csArray< const char *, csStringArrayElementHandler >::Length(). Referenced by scfStringArray::FindCaseInsensitive(). |
|
Find an element based on some key, using a csArrayCompareKeyFunction. The array must be sorted. Returns -1 if element does not exist. Reimplemented from csArray< const char *, csStringArrayElementHandler >. Definition at line 115 of file stringarray.h. References csArray< const char *, csStringArrayElementHandler >::ArrayCompareKeyFunction. Referenced by scfStringArray::FindSortedKey(). |
|
Insert a string element at a sorted position, using a specialized csArrayCompareFunction. Assumes array is already sorted. Definition at line 163 of file stringarray.h. References csArray< const char *, csStringArrayElementHandler >::ArrayCompareFunction. |
|
Pop an element from tail end of array. Caller is responsible for invoking delete[] on the returned string when no longer needed. Reimplemented from csArray< const char *, csStringArrayElementHandler >. Definition at line 125 of file stringarray.h. References csArray< const char *, csStringArrayElementHandler >::Get(), csArray< const char *, csStringArrayElementHandler >::InitRegion(), csArray< const char *, csStringArrayElementHandler >::Length(), and csArray< const char *, csStringArrayElementHandler >::SetLength(). Referenced by scfStringArray::Pop(). |
|
Sort array based on case sensitive string compare function.
Definition at line 106 of file stringarray.h. |
|
Sort array based on case sensitive string compare function.
Reimplemented from csArray< const char *, csStringArrayElementHandler >. Definition at line 98 of file stringarray.h. Referenced by scfStringArray::Sort(). |
The documentation for this class was generated from the following file:
- csutil/stringarray.h
Generated for Crystal Space by doxygen 1.2.18