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