iStringSet Struct Reference
[Utilities]
The string set is a collection of unique strings.
More...
#include <iutil/strset.h>
Inheritance diagram for iStringSet:

Public Member Functions | |
virtual void | Clear ()=0 |
Remove all stored strings. | |
virtual bool | Contains (csStringID) const =0 |
Check if the set contains a string with a particular ID. | |
virtual bool | Contains (char const *) const =0 |
Check if the set contains a particular string. | |
virtual bool | Delete (csStringID)=0 |
Remove a string with the specified ID. | |
virtual bool | Delete (char const *)=0 |
Remove specified string. | |
virtual void | Empty ()=0 |
Remove all stored strings. | |
virtual size_t | GetSize () const =0 |
Get the number of elements in the hash. | |
virtual bool | IsEmpty () const =0 |
Return true if the hash is empty. | |
virtual const char * | Request (csStringID) const =0 |
Request the string corresponding to the given ID. | |
virtual csStringID | Request (const char *)=0 |
Request the numeric ID for the given string. |
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.
As a convenience, the csInitializer class creates a string set at application initialization time and inserts it into the global object registry (iObjectRegistry). To obtain a reference this shared string set (which may be desirable when modules need to share string ID's), use a code snippet similar to the following:
iObjectRegistry* object_reg = ...; csRef<iStringSet> strings = CS_QUERY_REGISTRY_TAG_INTERFACE( object_reg, "crystalspace.shared.stringset", iStringSet);
- See also:
- csStringHash
Definition at line 64 of file strset.h.
Member Function Documentation
|
Remove all stored strings.
Implemented in csScfStringSet. |
|
Check if the set contains a string with a particular ID.
Implemented in csScfStringSet. |
|
Check if the set contains a particular string.
Implemented in csScfStringSet. |
|
Remove a string with the specified ID.
Implemented in csScfStringSet. |
|
Remove specified string.
Implemented in csScfStringSet. |
|
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. Implemented in csScfStringSet. |
|
Get the number of elements in the hash.
Implemented in csScfStringSet. |
|
Return true if the hash is empty.
Implemented in csScfStringSet. |
|
Request the string corresponding to the given ID.
Implemented in csScfStringSet. |
|
Request the numeric ID for the given string.
Implemented in csScfStringSet. |
The documentation for this struct was generated from the following file:
- iutil/strset.h
Generated for Crystal Space by doxygen 1.4.6