VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Common/Core/vtkStdString.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkStdString.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00029 #ifndef vtkStdString_h
00030 #define vtkStdString_h
00031 
00032 #include "vtkCommonCoreModule.h" // For export macro
00033 #include "vtkSystemIncludes.h" // For VTKCOMMONCORE_EXPORT.
00034 #include <string>       // For the superclass.
00035 
00036 class vtkStdString;
00037 VTKCOMMONCORE_EXPORT ostream& operator<<(ostream&, const vtkStdString&);
00038 
00039 // Workaround for a difference between GCC visibility and MSVC dllexport
00040 // Not setting the visibility of this class caused the
00041 // vtkArrayIteratorTemplate<vtkStdString> symbols to be hidden on Apple GCC 4.2
00042 // but exporting would cause failure on MSVC 10 (works either way with GCC 4.4
00043 #if defined(__APPLE__) && (__GNUC__==4) && (__GNUC_MINOR__<=2) && !defined(__clang__)
00044 class VTKCOMMONCORE_EXPORT vtkStdString : public std::string
00045 #else
00046 class vtkStdString : public std::string
00047 #endif
00048 {
00049 public:
00050   typedef std::string StdString;
00051   typedef StdString::value_type             value_type;
00052   typedef StdString::pointer                pointer;
00053   typedef StdString::reference              reference;
00054   typedef StdString::const_reference        const_reference;
00055   typedef StdString::size_type              size_type;
00056   typedef StdString::difference_type        difference_type;
00057   typedef StdString::iterator               iterator;
00058   typedef StdString::const_iterator         const_iterator;
00059   typedef StdString::reverse_iterator       reverse_iterator;
00060   typedef StdString::const_reverse_iterator const_reverse_iterator;
00061 
00062   vtkStdString(): StdString() {}
00063   vtkStdString(const value_type* s): StdString(s) {}
00064   vtkStdString(const value_type* s, size_type n): StdString(s, n) {}
00065   vtkStdString(const StdString& s, size_type pos=0, size_type n=npos):
00066     StdString(s, pos, n) {}
00067 
00068   operator const char *() { return this->c_str(); }
00069 };
00070 
00071 #endif
00072 // VTK-HeaderTest-Exclude: vtkStdString.h