csStringSet Class Reference
The string set is a collection of unique strings. More...
#include <csutil/strset.h>
Public Types | |
typedef csStringHash::GlobalIterator | GlobalIterator |
Public Member Functions | |
void | Clear () |
Remove all stored strings. | |
bool | Contains (csStringID id) const |
Check if the set contains a string with a particular ID. | |
bool | Contains (char const *) const |
Check if the set contains a particular string. | |
csStringSet (csStringSet const &s) | |
Copy constructor. | |
csStringSet (size_t size=23) | |
Constructor. | |
bool | Delete (csStringID id) |
Remove a string with the specified ID. | |
bool | Delete (char const *s) |
Remove specified string. | |
void | Empty () |
Remove all stored strings. | |
GlobalIterator | GetIterator () const |
Return an iterator for the set which iterates over all strings. | |
size_t | GetSize () const |
Get the number of elements in the hash. | |
bool | IsEmpty () const |
Return true if the hash is empty. | |
csStringSet & | operator= (csStringSet const &s) |
Assignment operator. | |
char const * | Request (csStringID) const |
Request the string corresponding to the given ID. | |
csStringID | Request (const char *) |
Request the numeric ID for the given string. | |
~csStringSet () | |
Destructor. |
Detailed Description
The string set is a collection of unique strings.Each string has an ID number. The most important operation is to request a string, which means to return the ID for the string, adding it to the collection if not already present. This is useful when you need to work with strings but want the performance characteristics of simple numeric comparisons. Rather than performing string comparisons, you instead compare the numeric string ID's.
- See also:
- csStringHash
Definition at line 39 of file strset.h.
Constructor & Destructor Documentation
|
Constructor.
|
|
Copy constructor.
|
|
Destructor.
|
Member Function Documentation
|
Remove all stored strings.
|
|
Check if the set contains a string with a particular ID.
|
|
Check if the set contains a particular string.
|
|
Remove a string with the specified ID.
|
|
Remove specified string.
|
|
Remove all stored strings. When new strings are registered again, new ID values will be used; the old ID's will not be re-used. |
|
Return an iterator for the set which iterates over all strings.
|
|
Get the number of elements in the hash.
|
|
Return true if the hash is empty.
|
|
Assignment operator.
|
|
Request the string corresponding to the given ID.
|
|
Request the numeric ID for the given string.
|
The documentation for this class was generated from the following file:
- csutil/strset.h
Generated for Crystal Space by doxygen 1.4.6