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