summaryrefslogtreecommitdiff
path: root/indra/llcommon/llinitparam.h
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-02-14 17:28:50 -0800
committerMerov Linden <merov@lindenlab.com>2013-02-14 17:28:50 -0800
commit4aa22db0379ba66017fe551c5466e4c1c6a888cb (patch)
treee302711c1f9e324ddefdc8ea821f4b980f28bf08 /indra/llcommon/llinitparam.h
parent96bc3d206d890255300d367a70493f93cd0dc5f8 (diff)
parent638d94eef75799d47f8b913e0909b4079e55c03b (diff)
Pull merge from lindenlab/viewer-chui
Diffstat (limited to 'indra/llcommon/llinitparam.h')
-rw-r--r--indra/llcommon/llinitparam.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h
index 75c87c4bdb..eb4d84d835 100644
--- a/indra/llcommon/llinitparam.h
+++ b/indra/llcommon/llinitparam.h
@@ -439,7 +439,7 @@ namespace LLInitParam
{}
void operator ()(const std::string& name)
- {
+ {
*this = name;
}
@@ -516,14 +516,29 @@ namespace LLInitParam
{
static bool read(T& param, Parser* parser)
{
- // read all enums as ints
+ std::string value_string;
+
+ // trying to get the declare value
+ parser_read_func_map_t::iterator string_func = parser->mParserReadFuncs->find(&typeid(std::string));
+ if (string_func != parser->mParserReadFuncs->end())
+ {
+ if (string_func->second(*parser, (void*)&value_string))
+ {
+ if (TypeValues<T>::getValueFromName(value_string, param))
+ {
+ return true;
+ }
+ }
+ }
+
+ // read enums as ints if it not declared as string
parser_read_func_map_t::iterator found_it = parser->mParserReadFuncs->find(&typeid(S32));
if (found_it != parser->mParserReadFuncs->end())
{
- S32 value;
- if (found_it->second(*parser, (void*)&value))
+ S32 value_S32;
+ if (found_it->second(*parser, (void*)&value_S32))
{
- param = (T)value;
+ param = (T)value_S32;
return true;
}
}