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
#ifndef __VTK_WRAP__
30
31
#include "vtkCommonCoreModule.h"
32
33
#ifndef VTK_SYSTEM_INCLUDES_INSIDE
34
Do_not_include_vtkOStreamWrapper_directly_vtkSystemIncludes_includes_it
;
35
#endif
36
37
class
vtkIndent
;
38
class
vtkObjectBase
;
39
class
vtkLargeInteger
;
40
class
vtkSmartPointerBase
;
41
class
vtkStdString
;
42
43
class
VTKCOMMONCORE_EXPORT
vtkOStreamWrapper
44
{
45
class
std_string;
46
public
:
48
52
vtkOStreamWrapper
(ostream& os);
53
vtkOStreamWrapper
(
vtkOStreamWrapper
& r);
55
56
virtual
~
vtkOStreamWrapper
();
57
61
struct
EndlType
{};
62
64
67
vtkOStreamWrapper
&
operator <<
(
const
EndlType
&);
68
vtkOStreamWrapper
&
operator <<
(
const
vtkIndent
&);
69
vtkOStreamWrapper
&
operator <<
(
vtkObjectBase
&);
70
vtkOStreamWrapper
&
operator <<
(
const
vtkLargeInteger
&);
71
vtkOStreamWrapper
&
operator <<
(
const
vtkSmartPointerBase
&);
72
vtkOStreamWrapper
&
operator <<
(
const
vtkStdString
&);
73
vtkOStreamWrapper
&
operator <<
(
const
char
*);
74
vtkOStreamWrapper
&
operator <<
(
void
*);
75
vtkOStreamWrapper
&
operator <<
(
char
);
76
vtkOStreamWrapper
&
operator <<
(
short
);
77
vtkOStreamWrapper
&
operator <<
(
int
);
78
vtkOStreamWrapper
&
operator <<
(
long
);
79
vtkOStreamWrapper
&
operator <<
(
long
long
);
80
vtkOStreamWrapper
&
operator <<
(
unsigned
char
);
81
vtkOStreamWrapper
&
operator <<
(
unsigned
short
);
82
vtkOStreamWrapper
&
operator <<
(
unsigned
int
);
83
vtkOStreamWrapper
&
operator <<
(
unsigned
long
);
84
vtkOStreamWrapper
&
operator <<
(
unsigned
long
long
);
85
vtkOStreamWrapper
&
operator <<
(
float
);
86
vtkOStreamWrapper
&
operator <<
(
double
);
87
vtkOStreamWrapper
&
operator <<
(
bool
);
89
90
// Work-around for IBM Visual Age bug in overload resolution.
91
#if defined(__IBMCPP__)
92
vtkOStreamWrapper
& WriteInternal(
const
char
*);
93
vtkOStreamWrapper
& WriteInternal(
void
*);
94
template
<
typename
T>
95
vtkOStreamWrapper
&
operator <<
(T* p)
96
{
97
return
this->WriteInternal(p);
98
}
99
#endif
100
101
vtkOStreamWrapper
&
operator <<
(
void
(*)(
void
*));
102
vtkOStreamWrapper
&
operator <<
(
void
* (*)(
void
*));
103
vtkOStreamWrapper
&
operator <<
(
int
(*)(
void
*));
104
vtkOStreamWrapper
&
operator <<
(
int
* (*)(
void
*));
105
vtkOStreamWrapper
&
operator <<
(
float
* (*)(
void
*));
106
vtkOStreamWrapper
&
operator <<
(
const
char
* (*)(
void
*));
107
vtkOStreamWrapper
&
operator <<
(
void
(*)(
void
*,
int
*));
108
109
// Accept std::string without a declaration.
110
template
<
template
<
typename
,
typename
,
typename
>
class
S>
111
vtkOStreamWrapper
&
operator <<
(
const
112
S<
char
, std::char_traits<char>, std::allocator<char> >& s)
113
{
114
return
*this << reinterpret_cast<std_string const&>(s);
115
}
116
120
vtkOStreamWrapper
& write(
const
char
*,
unsigned
long
);
121
125
ostream& GetOStream();
126
132
operator
ostream&();
133
137
operator
int
();
138
142
void
flush();
143
145
149
static
void
UseEndl
(
const
EndlType
&) {}
150
protected
:
151
// Reference to the real ostream.
152
ostream&
ostr
;
153
private
:
154
vtkOStreamWrapper
& operator=(
const
vtkOStreamWrapper
& r) =
delete
;
155
vtkOStreamWrapper
&
operator <<
(std_string
const
&);
156
};
158
159
#endif
160
#endif
161
// VTK-HeaderTest-Exclude: vtkOStreamWrapper.h
vtkSmartPointerBase
Non-templated superclass for vtkSmartPointer.
Definition:
vtkSmartPointerBase.h:32
vtkOStreamWrapper::EndlType
Type for a fake endl.
Definition:
vtkOStreamWrapper.h:61
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:43
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:149
Do_not_include_vtkOStreamWrapper_directly_vtkSystemIncludes_includes_it
Do_not_include_vtkOStreamWrapper_directly_vtkSystemIncludes_includes_it
Definition:
vtkOStreamWrapper.h:34
vtkStdString
Wrapper around std::string to keep symbols short.
Definition:
vtkStdString.h:40
vtkOStreamWrapper::ostr
ostream & ostr
Definition:
vtkOStreamWrapper.h:152
int
int
Definition:
vtkVectorOperators.h:164
vtkLargeInteger
class for arbitrarily large ints
Definition:
vtkLargeInteger.h:27
Generated by
1.8.16