diff options
Diffstat (limited to 'indra/llcommon/lldictionary.h')
-rw-r--r-- | indra/llcommon/lldictionary.h | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index 436b689ca6..4a2bfb9f3f 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -33,23 +33,11 @@ #define LL_LLDICTIONARY_H #include <map> +#include <string> -struct LLDictionaryEntry +struct LL_COMMON_API LLDictionaryEntry { - LLDictionaryEntry(const std::string &name) : - mName(name) - { - mNameCapitalized = mName; - LLStringUtil::replaceChar(mNameCapitalized, '-', ' '); - LLStringUtil::replaceChar(mNameCapitalized, '_', ' '); - for (U32 i=0; i < mNameCapitalized.size(); i++) - { - if (i == 0 || mNameCapitalized[i-1] == ' ') // don't change ordering of this statement or crash - { - mNameCapitalized[i] = toupper(mNameCapitalized[i]); - } - } - } + LLDictionaryEntry(const std::string &name); virtual ~LLDictionaryEntry() {} const std::string mName; std::string mNameCapitalized; @@ -88,11 +76,16 @@ public: return dictionary_iter->first; } } - llassert(false); - return Index(-1); + return notFound(); } protected: + virtual Index notFound() const + { + // default is to assert + llassert(false); + return Index(-1); + } void addEntry(Index index, Entry *entry) { if (lookup(index)) |