![]() |
Public API Reference |
#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. More... | |
void | Sort (ArraySortCompareFunction *compare) |
Sort array based on case sensitive string compare function. More... | |
void | Sort () |
Sort array based on case sensitive string compare function. More... | |
int | FindSortedKey (void *key, ArrayCompareKeyFunction *comparekey=CaseSensitiveCompareKey, int *candidate=0) const |
Find an element based on some key, using a csArrayCompareKeyFunction. More... | |
char * | Pop () |
Pop an element from tail end of array. More... | |
int | Find (const char *what) const |
Find a string, case-sensitive. More... | |
int | FindCaseInsensitive (const char *what) const |
Find a string, case-insensitive. More... |
This array will properly make copies of the strings and delete those copies using delete[] later.
Definition at line 50 of file csutil/stringarray.h.
|
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 csutil/stringarray.h. |
|
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 csutil/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 csutil/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 csutil/stringarray.h. References csArray< const char *, csStringArrayElementHandler >::ArrayCompareKeyFunction. Referenced by scfStringArray::FindSortedKey. |
|
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 csutil/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 csutil/stringarray.h. |
|
Sort array based on case sensitive string compare function.
Reimplemented from csArray< const char *, csStringArrayElementHandler >. Definition at line 98 of file csutil/stringarray.h. Referenced by scfStringArray::Sort. |