VTK
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 =========================================================================*/
30 #ifndef vtkStdString_h
31 #define vtkStdString_h
32 
33 #include "vtkCommonCoreModule.h" // For export macro
34 #include "vtkSystemIncludes.h" // For VTKCOMMONCORE_EXPORT.
35 #include <string> // For the superclass.
36 
37 class vtkStdString;
38 VTKCOMMONCORE_EXPORT ostream& operator<<(ostream&, const vtkStdString&);
39 
40 // Workaround for a difference between GCC visibility and MSVC dllexport
41 // Not setting the visibility of this class caused the
42 // vtkArrayIteratorTemplate<vtkStdString> symbols to be hidden on Apple GCC 4.2
43 // but exporting would cause failure on MSVC 10 (works either way with GCC 4.4
44 #if defined(__APPLE__) && (__GNUC__==4) && (__GNUC_MINOR__<=2) && !defined(__clang__)
45 class VTKCOMMONCORE_EXPORT vtkStdString : public std::string
46 #else
47 class vtkStdString : public std::string
48 #endif
49 {
50 public:
52  typedef StdString::value_type value_type;
53  typedef StdString::pointer pointer;
55  typedef StdString::const_reference const_reference;
56  typedef StdString::size_type size_type;
57  typedef StdString::difference_type difference_type;
58  typedef StdString::iterator iterator;
59  typedef StdString::const_iterator const_iterator;
60  typedef StdString::reverse_iterator reverse_iterator;
61  typedef StdString::const_reverse_iterator const_reverse_iterator;
62 
63  vtkStdString(): StdString() {}
64  vtkStdString(const value_type* s): StdString(s) {}
65  vtkStdString(const value_type* s, size_type n): StdString(s, n) {}
66  vtkStdString(const StdString& s, size_type pos=0, size_type n=npos):
67  StdString(s, pos, n) {}
68 
69  operator const char *() { return this->c_str(); }
70 };
71 
72 #endif
73 // VTK-HeaderTest-Exclude: vtkStdString.h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:47
vtkStdString(const value_type *s)
Definition: vtkStdString.h:64
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &, const vtkStdString &)
StdString::const_reverse_iterator const_reverse_iterator
Definition: vtkStdString.h:61
StdString::const_iterator const_iterator
Definition: vtkStdString.h:59
vtkStdString(const value_type *s, size_type n)
Definition: vtkStdString.h:65
StdString::difference_type difference_type
Definition: vtkStdString.h:57
StdString::reference reference
Definition: vtkStdString.h:54
StdString::pointer pointer
Definition: vtkStdString.h:53
StdString::size_type size_type
Definition: vtkStdString.h:56
StdString::const_reference const_reference
Definition: vtkStdString.h:55
std::string StdString
Definition: vtkStdString.h:51
StdString::value_type value_type
Definition: vtkStdString.h:52
vtkStdString(const StdString &s, size_type pos=0, size_type n=npos)
Definition: vtkStdString.h:66
StdString::reverse_iterator reverse_iterator
Definition: vtkStdString.h:60
StdString::iterator iterator
Definition: vtkStdString.h:58