Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Common/vtkOStreamWrapper.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkOStreamWrapper.h,v $ 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 #ifndef __VTK_SYSTEM_INCLUDES__INSIDE 00030 Do_not_include_vtkOStreamWrapper_directly__vtkSystemIncludes_includes_it; 00031 #endif 00032 00033 class vtkIndent; 00034 class vtkObjectBase; 00035 class vtkLargeInteger; 00036 class vtkSmartPointerBase; 00037 00038 class VTK_COMMON_EXPORT vtkOStreamWrapper 00039 { 00040 public: 00042 00044 vtkOStreamWrapper(ostream& os); 00045 vtkOStreamWrapper(vtkOStreamWrapper& r); 00047 00049 struct EndlType {}; 00050 00052 00053 vtkOStreamWrapper& operator << (const EndlType&); 00054 vtkOStreamWrapper& operator << (const vtkIndent&); 00055 vtkOStreamWrapper& operator << (vtkObjectBase&); 00056 vtkOStreamWrapper& operator << (const vtkLargeInteger&); 00057 vtkOStreamWrapper& operator << (const vtkSmartPointerBase&); 00058 vtkOStreamWrapper& operator << (ostream&); 00059 vtkOStreamWrapper& operator << (const char*); 00060 vtkOStreamWrapper& operator << (void*); 00061 vtkOStreamWrapper& operator << (char); 00062 vtkOStreamWrapper& operator << (short); 00063 vtkOStreamWrapper& operator << (int); 00064 vtkOStreamWrapper& operator << (long); 00065 vtkOStreamWrapper& operator << (unsigned char); 00066 vtkOStreamWrapper& operator << (unsigned short); 00067 vtkOStreamWrapper& operator << (unsigned int); 00068 vtkOStreamWrapper& operator << (unsigned long); 00069 vtkOStreamWrapper& operator << (float); 00070 vtkOStreamWrapper& operator << (double); 00072 00073 // Need to switch on bool type because this wrapper is supposed to 00074 // be as transparent as possible to user code. This example should 00075 // not be used to justify using bool elsewhere in VTK. 00076 #ifdef VTK_COMPILER_HAS_BOOL 00077 vtkOStreamWrapper& operator << (bool); 00078 #endif 00079 00080 // Work-around for IBM Visual Age bug in overload resolution. 00081 #if defined(__IBMCPP__) 00082 vtkOStreamWrapper& WriteInternal(const char*); 00083 vtkOStreamWrapper& WriteInternal(void*); 00084 template <typename T> 00085 vtkOStreamWrapper& operator << (T* p) 00086 { 00087 return this->WriteInternal(p); 00088 } 00089 #endif 00090 00091 #ifdef VTK_NEED_ID_TYPE_STREAM_OPERATORS 00092 vtkOStreamWrapper& operator << (vtkIdType); 00093 #endif 00094 vtkOStreamWrapper& operator << (void (*)(void*)); 00095 vtkOStreamWrapper& operator << (void* (*)(void*)); 00096 vtkOStreamWrapper& operator << (int (*)(void*)); 00097 vtkOStreamWrapper& operator << (int* (*)(void*)); 00098 vtkOStreamWrapper& operator << (float* (*)(void*)); 00099 vtkOStreamWrapper& operator << (const char* (*)(void*)); 00100 vtkOStreamWrapper& operator << (void (*)(void*, int*)); 00101 00103 vtkOStreamWrapper& write(const char*, unsigned long); 00104 00106 ostream& GetOStream(); 00107 00111 operator ostream&(); 00112 00114 operator int(); 00115 00117 void flush(); 00118 00121 static void UseEndl(const EndlType&) {} 00122 protected: 00123 // Reference to the real ostream. 00124 ostream& ostr; 00125 private: 00126 vtkOStreamWrapper& operator=(const vtkOStreamWrapper& r); // Not Implemented. 00127 }; 00128 00129 #endif