VTK
dox
Common
Core
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
=========================================================================*/
27
#ifndef vtkOStreamWrapper_h
28
#define vtkOStreamWrapper_h
29
30
#include "vtkCommonCoreModule.h"
31
32
#ifndef __VTK_SYSTEM_INCLUDES__INSIDE
33
Do_not_include_vtkOStreamWrapper_directly__vtkSystemIncludes_includes_it
;
34
#endif
35
36
class
vtkIndent
;
37
class
vtkObjectBase
;
38
class
vtkLargeInteger
;
39
class
vtkSmartPointerBase
;
40
// workaround clang bug, needs export on forward declaration
41
#ifdef __clang__
42
class
VTKCOMMONCORE_EXPORT
vtkStdString
;
43
#else
44
class
vtkStdString
;
45
#endif
46
47
class
VTKCOMMONCORE_EXPORT
vtkOStreamWrapper
48
{
49
class
std_string;
50
public
:
52
56
vtkOStreamWrapper
(ostream& os);
57
vtkOStreamWrapper
(
vtkOStreamWrapper
& r);
59
60
virtual
~
vtkOStreamWrapper
();
61
65
struct
EndlType
{};
66
68
71
vtkOStreamWrapper
&
operator <<
(
const
EndlType
&);
72
vtkOStreamWrapper
&
operator <<
(
const
vtkIndent
&);
73
vtkOStreamWrapper
&
operator <<
(
vtkObjectBase
&);
74
vtkOStreamWrapper
&
operator <<
(
const
vtkLargeInteger
&);
75
vtkOStreamWrapper
&
operator <<
(
const
vtkSmartPointerBase
&);
76
vtkOStreamWrapper
&
operator <<
(
const
vtkStdString
&);
77
vtkOStreamWrapper
&
operator <<
(
const
char
*);
78
vtkOStreamWrapper
&
operator <<
(
void
*);
79
vtkOStreamWrapper
&
operator <<
(
char
);
80
vtkOStreamWrapper
&
operator <<
(
short
);
81
vtkOStreamWrapper
&
operator <<
(
int
);
82
vtkOStreamWrapper
&
operator <<
(
long
);
83
vtkOStreamWrapper
&
operator <<
(
long
long
);
84
vtkOStreamWrapper
&
operator <<
(
unsigned
char
);
85
vtkOStreamWrapper
&
operator <<
(
unsigned
short
);
86
vtkOStreamWrapper
&
operator <<
(
unsigned
int
);
87
vtkOStreamWrapper
&
operator <<
(
unsigned
long
);
88
vtkOStreamWrapper
&
operator <<
(
unsigned
long
long
);
89
vtkOStreamWrapper
&
operator <<
(
float
);
90
vtkOStreamWrapper
&
operator <<
(
double
);
91
vtkOStreamWrapper
&
operator <<
(
bool
);
93
94
// Work-around for IBM Visual Age bug in overload resolution.
95
#if defined(__IBMCPP__)
96
vtkOStreamWrapper
& WriteInternal(
const
char
*);
97
vtkOStreamWrapper
& WriteInternal(
void
*);
98
template
<
typename
T>
99
vtkOStreamWrapper
&
operator <<
(T* p)
100
{
101
return
this->WriteInternal(p);
102
}
103
#endif
104
105
vtkOStreamWrapper
&
operator <<
(
void
(*)(
void
*));
106
vtkOStreamWrapper
&
operator <<
(
void
* (*)(
void
*));
107
vtkOStreamWrapper
&
operator <<
(
int
(*)(
void
*));
108
vtkOStreamWrapper
&
operator <<
(
int
* (*)(
void
*));
109
vtkOStreamWrapper
&
operator <<
(
float
* (*)(
void
*));
110
vtkOStreamWrapper
&
operator <<
(
const
char
* (*)(
void
*));
111
vtkOStreamWrapper
&
operator <<
(
void
(*)(
void
*,
int
*));
112
113
// Accept std::string without a declaration.
114
template
<
template
<
typename
,
typename
,
typename
>
class
S>
115
vtkOStreamWrapper
&
operator <<
(
const
116
S<
char
, std::char_traits<char>, std::allocator<char> >& s)
117
{
118
return
*this << reinterpret_cast<std_string const&>(s);
119
}
120
124
vtkOStreamWrapper
& write(
const
char
*,
unsigned
long
);
125
129
ostream& GetOStream();
130
136
operator
ostream&();
137
141
operator
int
();
142
146
void
flush();
147
149
153
static
void
UseEndl
(
const
EndlType
&) {}
154
protected
:
155
// Reference to the real ostream.
156
ostream&
ostr
;
157
private
:
158
vtkOStreamWrapper
& operator=(
const
vtkOStreamWrapper
& r) VTK_DELETE_FUNCTION;
159
vtkOStreamWrapper
&
operator <<
(std_string
const
&);
160
};
162
163
#endif
164
// VTK-HeaderTest-Exclude: vtkOStreamWrapper.h
Do_not_include_vtkOStreamWrapper_directly__vtkSystemIncludes_includes_it
Do_not_include_vtkOStreamWrapper_directly__vtkSystemIncludes_includes_it
Definition:
vtkOStreamWrapper.h:33
vtkSmartPointerBase
Non-templated superclass for vtkSmartPointer.
Definition:
vtkSmartPointerBase.h:32
vtkOStreamWrapper::EndlType
Type for a fake endl.
Definition:
vtkOStreamWrapper.h:65
vtkObjectBase
abstract base class for most VTK objects
Definition:
vtkObjectBase.h:65
vtkIndent
a simple class to control print indentation
Definition:
vtkIndent.h:39
operator<<
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkIndent &o)
vtkOStreamWrapper
Wrapper for C++ ostream. Internal VTK use only.
Definition:
vtkOStreamWrapper.h:47
vtkOStreamWrapper::UseEndl
static void UseEndl(const EndlType &)
Implementation detail to allow macros to provide an endl that may or may not be used.
Definition:
vtkOStreamWrapper.h:153
vtkStdString
Wrapper around std::string to keep symbols short.
Definition:
vtkStdString.h:47
vtkOStreamWrapper::ostr
ostream & ostr
Definition:
vtkOStreamWrapper.h:156
int
int
Definition:
vtkVectorOperators.h:164
vtkLargeInteger
class for arbitrarily large ints
Definition:
vtkLargeInteger.h:26
Generated by
1.8.16