summaryrefslogtreecommitdiff
path: root/indra/newview/tr.lproj
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2013-08-05 19:43:06 -0400
committerNat Goodspeed <nat@lindenlab.com>2013-08-05 19:43:06 -0400
commit7f6e7fc0cb15d5367d48a3d8084d1a0b319575b7 (patch)
treecb3c577d17607a644ab402afaa0c382379c9fe80 /indra/newview/tr.lproj
parentacda43ed3881eeab60ee9edfdf76ac8eebd723cc (diff)
CHOP-951, IQA-1477: Validate args for numeric command-line switches.
The logic in llcommandlineparser.cpp's setControlValueCB() callback function for converting command-line switch argument values from string to the actual type of the map-to settings variable had a couple special cases for boolean and LLSD array. But for S32, U32 and F32, it simply used default LLSD string-to-numeric conversion. LLSD's string-to-numeric conversion is a bit lame: for non-numeric strings, it shrugs and returns 0. Introduce onevalue() and badvalue() helper functions that, like certain errors during command-line parsing, throw LLCLPError. Use them to streamline certain redundancies in setControlValueCB(). Introduce convertTo<T>() helper function that uses boost::lexical_cast() for slightly more stringent conversions. Add cases for U32, S32 and F32 targets. setControlValueCB() is actually called only by LLControlGroupCLP::notify(), not during actual command-line parsing. Make LLControlGroupCLP::notify() return bool. Make it catch LLCLPError, set the error for getErrorMessage() and return false on that exception. Package LLAppViewer::initConfiguration()'s response to initParseCommandLine() returning false as a new handleCommandLineError() function; invoke it both there and when LLControlGroupCLP::notify() returns false.
Diffstat (limited to 'indra/newview/tr.lproj')
0 files changed, 0 insertions, 0 deletions