![]() |
VR-Forces Developer's Guide
|
This class allows one to collect and compare strings using an index number instead of having to do string compares. It is not virtual and is effectively 4 bytes meaning you can pass these by value as easily as passing a pointer.
When a symbol string is created from a string, the string is stored inside of a table of strings (managed by DtSymbolStore) and the symbol string is given a key with which to get the associated string from the table. As a result, unique strings are stored only once. This can result in significant memory savings if many instances of the same string were formerly stored in the system. Additionally, because each symbol string references its string by a key, string comparison becomes key comparison (much more efficient). In general, the symbol string classes are used in the reader/writer classes and the DtSpecification classes. You should not have to update code to use the DtSymbolStrings, other than to provide the appropriate functions if any classes were derived from reader/writer classes implementing member functions using DtSymbolStrings.
Public Member Functions | |
| DtSymbolString () | |
| DtSymbolString (const DtString &str) | |
| DtSymbolString (unsigned int i) | |
| ~DtSymbolString () | |
| DtSymbolString (const DtSymbolString &orig) | |
| DtSymbolString & | operator= (const DtString &orig) |
| DtSymbolString & | operator= (const char *orig) |
| operator const char * () const | |
| const char * | c_str () const |
| const char * | string () const |
| const unsigned int | symbol () const |
| DtSymbolString * | clone () |
| bool | operator== (const DtString &str) const |
| bool | operator!= (const DtString &str) const |
| bool | operator== (const char *str) const |
| bool | operator!= (const char *str) const |
| bool | operator== (const DtSymbolString &str) const |
| bool | operator!= (const DtSymbolString &str) const |
| bool | operator< (const DtSymbolString &str) const |
Protected Attributes | |
| unsigned int | mySymbol |
| DtSymbolString::DtSymbolString | ( | ) |
| DtSymbolString::DtSymbolString | ( | const DtString & | str | ) |
| DtSymbolString::~DtSymbolString | ( | ) |
| DtSymbolString::DtSymbolString | ( | const DtSymbolString & | orig | ) |
| DtSymbolString& DtSymbolString::operator= | ( | const DtString & | orig | ) |
| DtSymbolString& DtSymbolString::operator= | ( | const char * | orig | ) |
| DtSymbolString::operator const char * | ( | ) | const |
| const char* DtSymbolString::c_str | ( | ) | const |
Referenced by DtRwIntelCollectionArea::modifierForForce(), and DtRwTranslatableStringObject::translate().
| const char* DtSymbolString::string | ( | ) | const |
| DtSymbolString* DtSymbolString::clone | ( | ) |
| bool DtSymbolString::operator== | ( | const DtSymbolString & | str | ) | const |
| bool DtSymbolString::operator!= | ( | const DtSymbolString & | str | ) | const |
| bool DtSymbolString::operator< | ( | const DtSymbolString & | str | ) | const |