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

Public Member Functions | |
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 (int(*compare)(char const *const &, char const *const &)) |
Sort array based on comparison function. | |
void | Sort (bool case_sensitive=true) |
Sort array. | |
size_t | FindSortedKey (csArrayCmp< char const *, char const * > comparekey, size_t *candidate=0) const |
Find an element based on some key, using a comparison function. | |
size_t | FindSortedKey (char const *key, bool case_sensitive=true, size_t *candidate=0) const |
Find an element. | |
size_t | InsertSorted (const char *item, bool case_sensitive=true, size_t *equal_index=0) |
Insert an element at a sorted position. | |
char * | Pop () |
Pop an element from tail end of array. | |
size_t | Find (const char *what) const |
Find a string, case-sensitive. | |
size_t | FindCaseInsensitive (const char *what) const |
Find a string, case-insensitive. |
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 51 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 59 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 150 of file stringarray.h. References csArray< const char *, csStringArrayElementHandler >::Length(). |
|
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 162 of file stringarray.h. References csStrCaseCmp(), and csArray< const char *, csStringArrayElementHandler >::Length(). |
|
Find an element. The array must be sorted. Returns -1 if element does not exist. Definition at line 109 of file stringarray.h. References FindSortedKey(). |
|
Find an element based on some key, using a comparison function. The array must be sorted. Returns -1 if element does not exist. Definition at line 99 of file stringarray.h. Referenced by FindSortedKey(). |
|
Insert an element at a sorted position. Assumes array is already sorted. Definition at line 123 of file stringarray.h. |
|
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 136 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(). |
|
Sort array.
Definition at line 87 of file stringarray.h. References Sort(). |
|
Sort array based on comparison function.
Definition at line 79 of file stringarray.h. Referenced by Sort(). |
The documentation for this class was generated from the following file:
- csutil/stringarray.h
Generated for Crystal Space by doxygen 1.3.9.1