You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

StandardTraits.h 1.9 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
  2. /******************************************************************************
  3. *
  4. * file: StandardTraits.h
  5. *
  6. * Copyright (c) 2007, Daniel Aarno, Michael E. Smoot .
  7. * Copyright (c) 2017, Google LLC
  8. * All rights reserved.
  9. *
  10. * See the file COPYING in the top directory of this distribution for
  11. * more information.
  12. *
  13. * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  16. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  18. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  19. * DEALINGS IN THE SOFTWARE.
  20. *
  21. *****************************************************************************/
  22. // This is an internal tclap file, you should probably not have to
  23. // include this directly
  24. #ifndef TCLAP_STANDARD_TRAITS_H
  25. #define TCLAP_STANDARD_TRAITS_H
  26. #ifdef HAVE_CONFIG_H
  27. #include <config.h> // To check for long long
  28. #endif
  29. // If Microsoft has already typedef'd wchar_t as an unsigned
  30. // short, then compiles will break because it's as if we're
  31. // creating ArgTraits twice for unsigned short. Thus...
  32. #ifdef _MSC_VER
  33. #ifndef _NATIVE_WCHAR_T_DEFINED
  34. #define TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS
  35. #endif
  36. #endif
  37. namespace TCLAP
  38. {
  39. // Integer types (signed, unsigned and bool) and floating point types all
  40. // have value-like semantics.
  41. // Strings have string like argument traits.
  42. template<>
  43. struct ArgTraits<std::string>
  44. {
  45. typedef StringLike ValueCategory;
  46. };
  47. template<typename T>
  48. void SetString(T& dst, const std::string& src)
  49. {
  50. dst = src;
  51. }
  52. } // namespace TCLAP
  53. #endif