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