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