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