String.hxx.in 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*============================================================================
  2. KWSys - Kitware System Library
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef @KWSYS_NAMESPACE@_String_hxx
  11. #define @KWSYS_NAMESPACE@_String_hxx
  12. #include <@KWSYS_NAMESPACE@/stl/string>
  13. namespace @KWSYS_NAMESPACE@
  14. {
  15. /** \class String
  16. * \brief Short-name version of the STL basic_string class template.
  17. *
  18. * The standard library "string" type is actually a typedef for
  19. * "basic_string<..long argument list..>". This string class is
  20. * simply a subclass of this type with the same interface so that the
  21. * name is shorter in debugging symbols and error messages.
  22. */
  23. class @KWSYS_NAMESPACE@_EXPORT String: public @KWSYS_NAMESPACE@_stl::string
  24. {
  25. /** The original string type. */
  26. typedef @KWSYS_NAMESPACE@_stl::string stl_string;
  27. public:
  28. /** String member types. */
  29. typedef stl_string::value_type value_type;
  30. typedef stl_string::pointer pointer;
  31. typedef stl_string::reference reference;
  32. typedef stl_string::const_reference const_reference;
  33. typedef stl_string::size_type size_type;
  34. typedef stl_string::difference_type difference_type;
  35. typedef stl_string::iterator iterator;
  36. typedef stl_string::const_iterator const_iterator;
  37. typedef stl_string::reverse_iterator reverse_iterator;
  38. typedef stl_string::const_reverse_iterator const_reverse_iterator;
  39. /** String constructors. */
  40. String(): stl_string() {}
  41. String(const value_type* s): stl_string(s) {}
  42. String(const value_type* s, size_type n): stl_string(s, n) {}
  43. String(const stl_string& s, size_type pos=0, size_type n=npos):
  44. stl_string(s, pos, n) {}
  45. }; // End Class: String
  46. #if defined(__WATCOMC__)
  47. inline bool operator<(String const& l, String const& r)
  48. {
  49. return (static_cast<@KWSYS_NAMESPACE@_stl::string const&>(l) <
  50. static_cast<@KWSYS_NAMESPACE@_stl::string const&>(r));
  51. }
  52. #endif
  53. } // namespace @KWSYS_NAMESPACE@
  54. #endif