VTK  9.2.5
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 =========================================================================*/
96 #ifndef vtkStdString_h
97 #define vtkStdString_h
98 
99 #include "vtkCommonCoreModule.h" // For export macro
100 #include "vtkSystemIncludes.h" // For VTKCOMMONCORE_EXPORT.
101 #include <string> // For the superclass.
102 #include <utility> // For std::move
103 
104 class vtkStdString;
105 VTKCOMMONCORE_EXPORT ostream& operator<<(ostream&, const vtkStdString&);
106 
107 class vtkStdString : public std::string
108 {
109 public:
111  typedef StdString::value_type value_type;
112  typedef StdString::pointer pointer;
114  typedef StdString::const_reference const_reference;
115  typedef StdString::size_type size_type;
116  typedef StdString::difference_type difference_type;
117  typedef StdString::iterator iterator;
118  typedef StdString::const_iterator const_iterator;
119  typedef StdString::reverse_iterator reverse_iterator;
120  typedef StdString::const_reverse_iterator const_reverse_iterator;
121 
123  : std::string()
124  {
125  }
127  : std::string(s)
128  {
129  }
131  : std::string(s, n)
132  {
133  }
135  : std::string(s)
136  {
137  }
139  : std::string(std::move(s))
140  {
141  }
142  vtkStdString(const std::string& s, size_type pos, size_type n = std::string::npos)
143  : std::string(s, pos, n)
144  {
145  }
146 
147  operator const char*() { return this->c_str(); }
148 };
149 
150 #endif
151 // VTK-HeaderTest-Exclude: vtkStdString.h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:108
StdString::const_reference const_reference
Definition: vtkStdString.h:114
vtkStdString(const value_type *s, size_type n)
Definition: vtkStdString.h:130
StdString::size_type size_type
Definition: vtkStdString.h:115
StdString::reference reference
Definition: vtkStdString.h:113
vtkStdString(const value_type *s)
Definition: vtkStdString.h:126
vtkStdString(std::string &&s)
Definition: vtkStdString.h:138
StdString::const_iterator const_iterator
Definition: vtkStdString.h:118
StdString::const_reverse_iterator const_reverse_iterator
Definition: vtkStdString.h:120
std::string StdString
Definition: vtkStdString.h:110
StdString::reverse_iterator reverse_iterator
Definition: vtkStdString.h:119
vtkStdString(const std::string &s, size_type pos, size_type n=std::string::npos)
Definition: vtkStdString.h:142
StdString::pointer pointer
Definition: vtkStdString.h:112
StdString::value_type value_type
Definition: vtkStdString.h:111
StdString::difference_type difference_type
Definition: vtkStdString.h:116
StdString::iterator iterator
Definition: vtkStdString.h:117
vtkStdString(const std::string &s)
Definition: vtkStdString.h:134
@ reference
Definition: vtkX3D.h:470
@ string
Definition: vtkX3D.h:496
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &, const vtkStdString &)