Skip to content
Snippets Groups Projects
  1. Sep 05, 2013
  2. Aug 28, 2013
  3. Aug 26, 2013
  4. Aug 19, 2013
  5. Aug 15, 2013
  6. Aug 14, 2013
  7. Aug 13, 2013
  8. Aug 12, 2013
  9. Aug 11, 2013
  10. Aug 07, 2013
  11. Aug 06, 2013
  12. Aug 05, 2013
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
      CHOP-951, IQA-1477: Validate args for numeric command-line switches. · 7f6e7fc0
      Nat Goodspeed authored
      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.
      7f6e7fc0
Loading