VTK
vtkOStreamWrapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOStreamWrapper.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 =========================================================================*/
26 #ifndef __vtkOStreamWrapper_h
27 #define __vtkOStreamWrapper_h
28 
29 #include "vtkCommonCoreModule.h"
30 
31 #ifndef __VTK_SYSTEM_INCLUDES__INSIDE
33 #endif
34 
35 class vtkIndent;
36 class vtkObjectBase;
37 class vtkLargeInteger;
39 // workaround clang bug, needs export on forward declaration
40 #ifdef __clang__
42 #else
43 class vtkStdString;
44 #endif
45 
47 {
48 public:
50 
52  vtkOStreamWrapper(ostream& os);
55 
56  virtual ~vtkOStreamWrapper();
57 
59  struct EndlType {};
60 
62 
69  vtkOStreamWrapper& operator << (const char*);
75  vtkOStreamWrapper& operator << (unsigned char);
76  vtkOStreamWrapper& operator << (unsigned short);
77  vtkOStreamWrapper& operator << (unsigned int);
78  vtkOStreamWrapper& operator << (unsigned long);
81 #if defined(VTK_TYPE_USE_LONG_LONG)
82  vtkOStreamWrapper& operator << (long long);
83  vtkOStreamWrapper& operator << (unsigned long long);
84 #endif
85 #if defined(VTK_TYPE_USE___INT64)
87  vtkOStreamWrapper& operator << (unsigned __int64);
88 #endif
91 
92  // Work-around for IBM Visual Age bug in overload resolution.
93 #if defined(__IBMCPP__)
94  vtkOStreamWrapper& WriteInternal(const char*);
95  vtkOStreamWrapper& WriteInternal(void*);
96  template <typename T>
98  {
99  return this->WriteInternal(p);
100  }
101 #endif
102 
103  vtkOStreamWrapper& operator << (void (*)(void*));
104  vtkOStreamWrapper& operator << (void* (*)(void*));
105  vtkOStreamWrapper& operator << (int (*)(void*));
106  vtkOStreamWrapper& operator << (int* (*)(void*));
107  vtkOStreamWrapper& operator << (float* (*)(void*));
108  vtkOStreamWrapper& operator << (const char* (*)(void*));
109  vtkOStreamWrapper& operator << (void (*)(void*, int*));
110 
112  vtkOStreamWrapper& write(const char*, unsigned long);
113 
115  ostream& GetOStream();
116 
120  operator ostream&();
121 
123  operator int();
124 
126  void flush();
127 
129 
131  static void UseEndl(const EndlType&) {}
132 protected:
133  // Reference to the real ostream.
134  ostream& ostr;
135 private:
136  vtkOStreamWrapper& operator=(const vtkOStreamWrapper& r); // Not Implemented.
137 };
139 
140 #endif
141 // VTK-HeaderTest-Exclude: vtkOStreamWrapper.h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
#define VTKCOMMONCORE_EXPORT
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
Do_not_include_vtkOStreamWrapper_directly__vtkSystemIncludes_includes_it
Wrapper for C++ ostream. Internal VTK use only.
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract base class for most VTK objects
Definition: vtkObjectBase.h:58
Non-templated superclass for vtkSmartPointer.
static void UseEndl(const EndlType &)
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkIndent &o)
class for arbitrarily large ints
GLfloat GLfloat p
Definition: vtkgl.h:15717