VTK
dox/Common/Core/vtkOStreamWrapper.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkOStreamWrapper.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 =========================================================================*/
00026 #ifndef __vtkOStreamWrapper_h
00027 #define __vtkOStreamWrapper_h
00028 
00029 #include "vtkCommonCoreModule.h"
00030 
00031 #ifndef __VTK_SYSTEM_INCLUDES__INSIDE
00032 Do_not_include_vtkOStreamWrapper_directly__vtkSystemIncludes_includes_it;
00033 #endif
00034 
00035 class vtkIndent;
00036 class vtkObjectBase;
00037 class vtkLargeInteger;
00038 class vtkSmartPointerBase;
00039 // workaround clang bug, needs export on forward declaration
00040 #ifdef __clang__
00041 class VTKCOMMONCORE_EXPORT vtkStdString;
00042 #else
00043 class vtkStdString;
00044 #endif
00045 
00046 class VTKCOMMONCORE_EXPORT vtkOStreamWrapper
00047 {
00048 public:
00050 
00052   vtkOStreamWrapper(ostream& os);
00053   vtkOStreamWrapper(vtkOStreamWrapper& r);
00055 
00056   virtual ~vtkOStreamWrapper();
00057 
00059   struct EndlType {};
00060 
00062 
00063   vtkOStreamWrapper& operator << (const EndlType&);
00064   vtkOStreamWrapper& operator << (const vtkIndent&);
00065   vtkOStreamWrapper& operator << (vtkObjectBase&);
00066   vtkOStreamWrapper& operator << (const vtkLargeInteger&);
00067   vtkOStreamWrapper& operator << (const vtkSmartPointerBase&);
00068   vtkOStreamWrapper& operator << (const vtkStdString&);
00069   vtkOStreamWrapper& operator << (const char*);
00070   vtkOStreamWrapper& operator << (void*);
00071   vtkOStreamWrapper& operator << (char);
00072   vtkOStreamWrapper& operator << (short);
00073   vtkOStreamWrapper& operator << (int);
00074   vtkOStreamWrapper& operator << (long);
00075   vtkOStreamWrapper& operator << (unsigned char);
00076   vtkOStreamWrapper& operator << (unsigned short);
00077   vtkOStreamWrapper& operator << (unsigned int);
00078   vtkOStreamWrapper& operator << (unsigned long);
00079   vtkOStreamWrapper& operator << (float);
00080   vtkOStreamWrapper& operator << (double);
00081 #if defined(VTK_TYPE_USE_LONG_LONG)
00082   vtkOStreamWrapper& operator << (long long);
00083   vtkOStreamWrapper& operator << (unsigned long long);
00084 #endif
00085 #if defined(VTK_TYPE_USE___INT64)
00086   vtkOStreamWrapper& operator << (__int64);
00087   vtkOStreamWrapper& operator << (unsigned __int64);
00088 #endif
00089   vtkOStreamWrapper& operator << (bool);
00091 
00092   // Work-around for IBM Visual Age bug in overload resolution.
00093 #if defined(__IBMCPP__)
00094   vtkOStreamWrapper& WriteInternal(const char*);
00095   vtkOStreamWrapper& WriteInternal(void*);
00096   template <typename T>
00097   vtkOStreamWrapper& operator << (T* p)
00098     {
00099     return this->WriteInternal(p);
00100     }
00101 #endif
00102 
00103   vtkOStreamWrapper& operator << (void (*)(void*));
00104   vtkOStreamWrapper& operator << (void* (*)(void*));
00105   vtkOStreamWrapper& operator << (int (*)(void*));
00106   vtkOStreamWrapper& operator << (int* (*)(void*));
00107   vtkOStreamWrapper& operator << (float* (*)(void*));
00108   vtkOStreamWrapper& operator << (const char* (*)(void*));
00109   vtkOStreamWrapper& operator << (void (*)(void*, int*));
00110 
00112   vtkOStreamWrapper& write(const char*, unsigned long);
00113 
00115   ostream& GetOStream();
00116 
00120   operator ostream&();
00121 
00123   operator int();
00124 
00126   void flush();
00127 
00129 
00131   static void UseEndl(const EndlType&) {}
00132 protected:
00133   // Reference to the real ostream.
00134   ostream& ostr;
00135 private:
00136   vtkOStreamWrapper& operator=(const vtkOStreamWrapper& r); // Not Implemented.
00137 };
00139 
00140 #endif
00141 // VTK-HeaderTest-Exclude: vtkOStreamWrapper.h