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 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00030 #ifndef __vtkOStreamWrapper_h 00031 #define __vtkOStreamWrapper_h 00032 00033 #ifndef __VTK_SYSTEM_INCLUDES__INSIDE 00034 Do_not_include_vtkOStreamWrapper_directly__vtkSystemIncludes_includes_it; 00035 #endif 00036 00037 class vtkIndent; 00038 class vtkObjectBase; 00039 class vtkLargeInteger; 00040 class vtkSmartPointerBase; 00041 00042 class VTK_COMMON_EXPORT vtkOStreamWrapper 00043 { 00044 public: 00046 00048 vtkOStreamWrapper(ostream& os); 00049 vtkOStreamWrapper(vtkOStreamWrapper& r); 00051 00053 struct EndlType {}; 00054 00056 00057 vtkOStreamWrapper& operator << (const EndlType&); 00058 vtkOStreamWrapper& operator << (const vtkIndent&); 00059 vtkOStreamWrapper& operator << (vtkObjectBase&); 00060 vtkOStreamWrapper& operator << (const vtkLargeInteger&); 00061 vtkOStreamWrapper& operator << (const vtkSmartPointerBase&); 00062 vtkOStreamWrapper& operator << (ostream&); 00063 vtkOStreamWrapper& operator << (const char*); 00064 vtkOStreamWrapper& operator << (void*); 00065 vtkOStreamWrapper& operator << (char); 00066 vtkOStreamWrapper& operator << (short); 00067 vtkOStreamWrapper& operator << (int); 00068 vtkOStreamWrapper& operator << (long); 00069 vtkOStreamWrapper& operator << (unsigned char); 00070 vtkOStreamWrapper& operator << (unsigned short); 00071 vtkOStreamWrapper& operator << (unsigned int); 00072 vtkOStreamWrapper& operator << (unsigned long); 00073 vtkOStreamWrapper& operator << (float); 00074 vtkOStreamWrapper& operator << (double); 00076 00077 // Need to switch on bool type because this wrapper is supposed to 00078 // be as transparent as possible to user code. This example should 00079 // not be used to justify using bool elsewhere in VTK. 00080 #ifdef VTK_COMPILER_HAS_BOOL 00081 vtkOStreamWrapper& operator << (bool); 00082 #endif 00083 00084 #ifdef VTK_NEED_ID_TYPE_STREAM_OPERATORS 00085 vtkOStreamWrapper& operator << (vtkIdType); 00086 #endif 00087 vtkOStreamWrapper& operator << (void (*)(void*)); 00088 vtkOStreamWrapper& operator << (void* (*)(void*)); 00089 vtkOStreamWrapper& operator << (int (*)(void*)); 00090 vtkOStreamWrapper& operator << (int* (*)(void*)); 00091 vtkOStreamWrapper& operator << (float* (*)(void*)); 00092 vtkOStreamWrapper& operator << (const char* (*)(void*)); 00093 vtkOStreamWrapper& operator << (void (*)(void*, int*)); 00094 00096 vtkOStreamWrapper& write(const char*, unsigned long); 00097 00099 ostream& GetOStream(); 00100 00104 operator ostream&(); 00105 00107 operator int(); 00108 00110 void flush(); 00111 00114 static void UseEndl(const EndlType&) {} 00115 protected: 00116 // Reference to the real ostream. 00117 ostream& ostr; 00118 private: 00119 vtkOStreamWrapper& operator=(const vtkOStreamWrapper& r); // Not Implemented. 00120 }; 00121 00122 #endif