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