VTK  9.4.20241108
vtkStdString.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
64#ifndef vtkStdString_h
65#define vtkStdString_h
66
67#include "vtkCommonCoreModule.h" // For export macro
68#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
69#include "vtkSystemIncludes.h" // For VTKCOMMONCORE_EXPORT.
70#include <string> // For the superclass.
71#include <utility> // For std::move
72
73VTK_ABI_NAMESPACE_BEGIN
74class vtkStdString;
75VTKCOMMONCORE_EXPORT ostream& operator<<(ostream&, const vtkStdString&);
76
77class vtkStdString : public std::string
78{
79public:
80 typedef std::string StdString;
81 typedef StdString::value_type value_type;
82 typedef StdString::pointer pointer;
83 typedef StdString::reference reference;
84 typedef StdString::const_reference const_reference;
85 typedef StdString::size_type size_type;
86 typedef StdString::difference_type difference_type;
87 typedef StdString::iterator iterator;
88 typedef StdString::const_iterator const_iterator;
89 typedef StdString::reverse_iterator reverse_iterator;
90 typedef StdString::const_reverse_iterator const_reverse_iterator;
91
92 vtkStdString() = default;
94 : std::string(s)
95 {
96 }
98 : std::string(s, n)
99 {
100 }
101 vtkStdString(const std::string& s)
102 : std::string(s)
103 {
104 }
105 vtkStdString(std::string&& s)
106 : std::string(std::move(s))
107 {
108 }
109 vtkStdString(const std::string& s, size_type pos, size_type n = std::string::npos)
110 : std::string(s, pos, n)
111 {
112 }
113
114 VTK_DEPRECATED_IN_9_3_0("Call `.c_str()` explicitly")
115 operator const char*() { return this->c_str(); }
116};
117
118VTK_ABI_NAMESPACE_END
119#endif
120// VTK-HeaderTest-Exclude: vtkStdString.h
Wrapper around std::string to keep symbols short.
StdString::const_reference const_reference
vtkStdString(const value_type *s, size_type n)
StdString::size_type size_type
StdString::reference reference
vtkStdString(const value_type *s)
vtkStdString(std::string &&s)
StdString::const_iterator const_iterator
StdString::const_reverse_iterator const_reverse_iterator
std::string StdString
StdString::reverse_iterator reverse_iterator
vtkStdString()=default
vtkStdString(const std::string &s, size_type pos, size_type n=std::string::npos)
StdString::pointer pointer
StdString::value_type value_type
StdString::difference_type difference_type
StdString::iterator iterator
vtkStdString(const std::string &s)
#define VTK_DEPRECATED_IN_9_3_0(reason)
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &, const vtkStdString &)