String.hxx.in 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*=========================================================================
  2. Program: KWSys - Kitware System Library
  3. Module: $RCSfile$
  4. Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
  5. See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even
  7. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  8. PURPOSE. See the above copyright notices 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 "std::string" type is actually a typedef for
  19. * "std::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. } // namespace @KWSYS_NAMESPACE@
  47. #endif