VTK  9.3.0
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
24#ifndef vtkStdString_h
25#define vtkStdString_h
26
27#include "vtkCommonCoreModule.h" // For export macro
28#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
29#include "vtkSystemIncludes.h" // For VTKCOMMONCORE_EXPORT.
30#include <string> // For the superclass.
31#include <utility> // For std::move
32
33VTK_ABI_NAMESPACE_BEGIN
34class vtkStdString;
35VTKCOMMONCORE_EXPORT ostream& operator<<(ostream&, const vtkStdString&);
36
37class vtkStdString : public std::string
38{
39public:
40 typedef std::string StdString;
41 typedef StdString::value_type value_type;
42 typedef StdString::pointer pointer;
43 typedef StdString::reference reference;
44 typedef StdString::const_reference const_reference;
45 typedef StdString::size_type size_type;
46 typedef StdString::difference_type difference_type;
47 typedef StdString::iterator iterator;
48 typedef StdString::const_iterator const_iterator;
49 typedef StdString::reverse_iterator reverse_iterator;
50 typedef StdString::const_reverse_iterator const_reverse_iterator;
51
52 vtkStdString() = default;
54 : std::string(s)
55 {
56 }
58 : std::string(s, n)
59 {
60 }
61 vtkStdString(const std::string& s)
62 : std::string(s)
63 {
64 }
65 vtkStdString(std::string&& s)
66 : std::string(std::move(s))
67 {
68 }
69 vtkStdString(const std::string& s, size_type pos, size_type n = std::string::npos)
70 : std::string(s, pos, n)
71 {
72 }
73
74 VTK_DEPRECATED_IN_9_3_0("Call `.c_str()` explicitly")
75 operator const char*() { return this->c_str(); }
76};
77
78VTK_ABI_NAMESPACE_END
79#endif
80// 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 &)