VTK  9.2.6
vtkStdString.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkStdString.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkStdString_h
28 #define vtkStdString_h
29 
30 #include "vtkCommonCoreModule.h" // For export macro
31 #include "vtkSystemIncludes.h" // For VTKCOMMONCORE_EXPORT.
32 #include <string> // For the superclass.
33 #include <utility> // For std::move
34 
35 class vtkStdString;
36 VTKCOMMONCORE_EXPORT ostream& operator<<(ostream&, const vtkStdString&);
37 
38 class vtkStdString : public std::string
39 {
40 public:
42  typedef StdString::value_type value_type;
43  typedef StdString::pointer pointer;
45  typedef StdString::const_reference const_reference;
46  typedef StdString::size_type size_type;
47  typedef StdString::difference_type difference_type;
48  typedef StdString::iterator iterator;
49  typedef StdString::const_iterator const_iterator;
50  typedef StdString::reverse_iterator reverse_iterator;
51  typedef StdString::const_reverse_iterator const_reverse_iterator;
52 
54  : std::string()
55  {
56  }
57  vtkStdString(const value_type* s)
58  : std::string(s)
59  {
60  }
61  vtkStdString(const value_type* s, size_type n)
62  : std::string(s, n)
63  {
64  }
66  : std::string(s)
67  {
68  }
70  : std::string(std::move(s))
71  {
72  }
73  vtkStdString(const std::string& s, size_type pos, size_type n = std::string::npos)
74  : std::string(s, pos, n)
75  {
76  }
77 
78  operator const char*() { return this->c_str(); }
79 };
80 
81 #endif
82 // VTK-HeaderTest-Exclude: vtkStdString.h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
vtkStdString(const value_type *s)
Definition: vtkStdString.h:57
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &, const vtkStdString &)
StdString::const_reverse_iterator const_reverse_iterator
Definition: vtkStdString.h:51
StdString::const_iterator const_iterator
Definition: vtkStdString.h:49
vtkStdString(const value_type *s, size_type n)
Definition: vtkStdString.h:61
StdString::difference_type difference_type
Definition: vtkStdString.h:47
vtkStdString(const std::string &s, size_type pos, size_type n=std::string::npos)
Definition: vtkStdString.h:73
StdString::reference reference
Definition: vtkStdString.h:44
StdString::pointer pointer
Definition: vtkStdString.h:43
StdString::size_type size_type
Definition: vtkStdString.h:46
StdString::const_reference const_reference
Definition: vtkStdString.h:45
vtkStdString(std::string &&s)
Definition: vtkStdString.h:69
std::string StdString
Definition: vtkStdString.h:41
StdString::value_type value_type
Definition: vtkStdString.h:42
vtkStdString(const std::string &s)
Definition: vtkStdString.h:65
StdString::reverse_iterator reverse_iterator
Definition: vtkStdString.h:50
StdString::iterator iterator
Definition: vtkStdString.h:48