Skip to content
Snippets Groups Projects
  1. Sep 29, 2020
  2. Sep 28, 2020
  3. Sep 10, 2020
  4. Aug 24, 2020
  5. Mar 25, 2020
  6. Mar 19, 2020
  7. Apr 16, 2019
  8. Dec 15, 2018
    • Nat Goodspeed's avatar
      SL-10153: auto name{expression} declares an initializer_list · 4a136572
      Nat Goodspeed authored
      instead of a variable of type decltype(expression).
      
      Using SHGetKnownFolderPath(FOLDERID_Fonts) in LLFontGL::getFontPathSystem()
      requires new Windows #include files.
      
      A variable with a constructor can't be declared within the braces of a switch
      statement, even outside any of its case clauses.
      4a136572
  9. Dec 14, 2018
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
      SL-10153: Fix previous commit for non-Windows systems. · 132e708f
      Nat Goodspeed authored
      Move Windows-flavored llstring_getoptenv() to Windows-specific section of
      llstring.cpp.
      
      boost::optional type must be stated explicitly to initialize with a value.
      
      On platforms where llwchar is the same as wchar_t, LLWString is the same as
      std::wstring, so ll_convert specializations for std::wstring would duplicate
      those for LLWString. Defend against that.
      
      The compilers we use don't like 'return condition? { expr } : {}', in which we
      hope to construct and return an instance of the declared return type without
      having to restate the type. It works to use an explicit 'if' statement.
      132e708f
    • Nat Goodspeed's avatar
      SL-10153: Introduce ll_convert, windows_message() templates. · 9ffcafb6
      Nat Goodspeed authored
      Add ll_convert<TO, FROM> template, used as (e.g.):
      ll_convert<std::string>(value_of_some_other_string_type);
      There is no generic template implementation -- the template exists solely to
      provide generic aliases for a bewildering family of llstring.h string-
      conversion functions with highly-specific names. There's a generic
      implementation, though, for the degenerate case where FROM and TO are
      identical.
      
      Add ll_convert<> specialization aliases for most of the string-conversion
      functions declared in llstring.h, including the Windows-specific ones
      involving llutf16string and std::wstring.
      
      Add a mini-lecture in llstring.h about appropriate use of string types on
      Windows.
      
      Add LL_WCHAR_T_NATIVE llpreprocessor.h macro so we can detect whether to
      provide separate conversions for llutf16string and std::wstring, or whether
      those would collide because the types are identical.
      
      Add inline ll_convert_wide_to_string(const std::wstring&) overloads so caller
      isn't required to call arg.c_str(), which naturally permits an ll_convert
      alias.
      
      Add ll_convert_wide_to_wstring(), ll_convert_wstring_to_wide() as placeholders
      for converting between Windows std::wstring and Linden LLWString, with
      corresponding ll_convert aliases. We don't yet have library code to perform
      such conversions officially; for now, just copy characters.
      
      Add LLStringUtil::getenv(key) and getoptenv(key) functions. The latter returns
      boost::optional<string_type> in case the caller needs to detect absence of a
      given environment variable rather than simply accepting a default value.
      Naturally getenv(), which accepts a default, is implemented using getoptenv().
      getoptenv(), in turn, is implemented using an underlying llstring_getoptenv().
      
      On Windows, llstring_getoptenv() returns boost::optional<std::wstring> (based
      on GetEnvironmentVariableW()), whereas elsewhere, llstring_getoptenv() returns
      boost::optional<std::string> (based on classic Posix getenv()).
      
      The beauty of generic ll_convert is that the portable LLStringUtilBase<T>::
      getoptenv() template can call the platform-specific llstring_getoptenv() and
      transparently perform whatever conversion is necessary to return the desired
      string_type.
      
      Add windows_message<T>(error) template, with an overload that implicitly calls
      GetLastError(). We provide a single concrete windows_message<std::wstring>()
      implementation because that's what we get from Windows FormatMessageW() --
      everything else is a generic conversion to the desired target string type.
      
      This obviates llprocess.cpp's previous WindowsErrorString() implementation --
      reimplement using windows_message<std::string>().
      9ffcafb6
  10. Dec 11, 2018
    • Nat Goodspeed's avatar
      SL-10153: Improve ll_convert_string_to_wide() and its converse. · 4e894eb2
      Nat Goodspeed authored
      Instead of returning a wchar_t* and requiring the caller to delete it later,
      return a std::basic_string<wchar_t> that's self-cleaning. If the caller wants
      a wchar_t*, s/he can call c_str() on the returned string.
      
      Default the code_page parameter to CP_UTF8, since we try to be really
      consistent about using UTF-8 encoding for all our internal std::strings.
      4e894eb2
  11. Oct 03, 2017
  12. Jun 16, 2017
  13. Apr 02, 2017
  14. Dec 20, 2016
  15. Dec 07, 2016
  16. Nov 20, 2016
  17. Jun 01, 2016
  18. Nov 10, 2015
  19. Jun 30, 2015
  20. Jan 16, 2014
  21. Jul 19, 2013
  22. May 22, 2013
  23. Mar 29, 2013
  24. Nov 15, 2012
    • Richard Linden's avatar
      SH-3406 WIP convert fast timers to lltrace system · 9d77e030
      Richard Linden authored
      cleaning up build
      moved most includes of windows.h to llwin32headers.h to disable min/max macros, etc
      streamlined Time class and consolidated functionality in BlockTimer class
      llfasttimer is no longer included via llstring.h, so had to add it manually in several places
      9d77e030
  25. Mar 23, 2012
  26. Feb 24, 2012
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
      Add LLStringUtil::getTokens() overload handling quoted substrings. · 025329b6
      Nat Goodspeed authored
      We didn't have any tokenizer suitable for scanning something like a bash
      command line. We do have a couple hacks, e.g. LLExternalEditor::tokenize() and
      LLCommandLineParser::parseCommandLineString(). Both try to work around
      boost::tokenizer limitations; but existing boost::tokenizer support just
      doesn't address this case. Neither of the above is available as a general
      scanner anyway, and parseCommandLineString() fails outright when passed "".
      New getTokens() also distinguishes between "drop delimiters" (e.g. space,
      return, newline) to be discarded from the token stream, versus "keep
      delimiters" (e.g. "+-*/") to be returned as tokens in their own right.
      There's an overload that honors escapes and a more efficient one that doesn't;
      each has a convenience overload that returns the scanned string vector rather
      than requiring a separate declaration.
      Tweak and comment older getTokens() implementation.
      Add unit tests for both old and new getTokens() implementations.
      Break out StringVec and std::ostream << StringVec from
      indra/llcommon/tests/listener.h to StringVec.h: that's coming in handy for a
      number of different TUT test sources.
      025329b6
  27. Jan 27, 2012
    • Nat Goodspeed's avatar
      On Windows, only quote LLProcess arguments if they seem to need it. · 27df0a84
      Nat Goodspeed authored
      On Posix platforms, the OS argument mechanism makes quoting/reparsing
      unnecessary anyway, so this only affects Windows.
      Add optional 'triggers' parameter to LLStringUtils::quote() (default: space
      and double-quote). Only if the passed string contains a character in
      'triggers' will it be double-quoted.
      This is observed to fix a Windows-specific problem in which plugin child
      process would fail to start because it wasn't expecting a quoted number.
      Use LLStringUtils::quote() more consistently in LLProcess implementation for
      logging.
      27df0a84
  28. Jan 23, 2012
  29. Jan 20, 2012
  30. Oct 13, 2010
  31. Sep 21, 2010
  32. Sep 13, 2010
  33. Aug 13, 2010
  34. Jul 23, 2010
    • Mike Antipov's avatar
      EXT-8318 ADDITIONAL FIXED ensure that thousands separator is in utf8 format... · 3c4f82b2
      Mike Antipov authored
      EXT-8318 ADDITIONAL FIXED ensure that thousands separator is in utf8 format (on Windows) before converting it to LLWString.
      
      Problem on Windows:
      ==================
      
      LLPanelMainInventory::updateItemcountText() formats number using viewer locale.
      non-break space is detected as unknown symbols while converting utf8str_to_wstring when formatted text is set to LLTextBox.
      
      FIX:
      ===
      
      Added converting of string to multi-byte string and then to utf8 string while formatting on Windows.
        created opposite to "ll_convert_wide_to_string" function "ll_convert_string_to_wide" and helper function to call both of them.
        It is used now to convert result of formatted string while formatting integer number in locale.
      
      Fix affects Windows only.
      
      Reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/775/
      
      --HG--
      branch : product-engine
      3c4f82b2
Loading