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 =========================================================================*/
36 #ifndef vtkStdString_h
37 #define vtkStdString_h
38 
39 #include "vtkCommonCoreModule.h" // For export macro
40 #include "vtkSystemIncludes.h" // For VTKCOMMONCORE_EXPORT.
41 #include <string> // For the superclass.
42 #include <utility> // For std::move
43 
44 class vtkStdString;
45 VTKCOMMONCORE_EXPORT ostream& operator<<(ostream&, const vtkStdString&);
46 
47 class vtkStdString : public std::string
48 {
49 public:
51  typedef StdString::value_type value_type;
52  typedef StdString::pointer pointer;
54  typedef StdString::const_reference const_reference;
55  typedef StdString::size_type size_type;
56  typedef StdString::difference_type difference_type;
57  typedef StdString::iterator iterator;
58  typedef StdString::const_iterator const_iterator;
59  typedef StdString::reverse_iterator reverse_iterator;
60  typedef StdString::const_reverse_iterator const_reverse_iterator;
61 
63  : std::string()
64  {
65  }
67  : std::string(s)
68  {
69  }
71  : std::string(s, n)
72  {
73  }
75  : std::string(s)
76  {
77  }
79  : std::string(std::move(s))
80  {
81  }
82  vtkStdString(const std::string& s, size_type pos, size_type n = std::string::npos)
83  : std::string(s, pos, n)
84  {
85  }
86 
87  operator const char*() { return this->c_str(); }
88 };
89 
90 #endif
91 // VTK-HeaderTest-Exclude: vtkStdString.h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:48
StdString::const_reference const_reference
Definition: vtkStdString.h:54
vtkStdString(const value_type *s, size_type n)
Definition: vtkStdString.h:70
StdString::size_type size_type
Definition: vtkStdString.h:55
StdString::reference reference
Definition: vtkStdString.h:53
vtkStdString(const value_type *s)
Definition: vtkStdString.h:66
vtkStdString(std::string &&s)
Definition: vtkStdString.h:78
StdString::const_iterator const_iterator
Definition: vtkStdString.h:58
StdString::const_reverse_iterator const_reverse_iterator
Definition: vtkStdString.h:60
std::string StdString
Definition: vtkStdString.h:50
StdString::reverse_iterator reverse_iterator
Definition: vtkStdString.h:59
vtkStdString(const std::string &s, size_type pos, size_type n=std::string::npos)
Definition: vtkStdString.h:82
StdString::pointer pointer
Definition: vtkStdString.h:52
StdString::value_type value_type
Definition: vtkStdString.h:51
StdString::difference_type difference_type
Definition: vtkStdString.h:56
StdString::iterator iterator
Definition: vtkStdString.h:57
vtkStdString(const std::string &s)
Definition: vtkStdString.h:74
@ reference
Definition: vtkX3D.h:470
@ string
Definition: vtkX3D.h:496
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &, const vtkStdString &)