VTK: IO/Core/vtkOutputStream.h Source File

| VTK 9.3.1

vtkOutputStream.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkOutputStream_h
16 #define vtkOutputStream_h
17
18 #include "vtkIOCoreModule.h" // For export macro
19 #include "vtkObject.h"
20
21 VTK_ABI_NAMESPACE_BEGIN
22 class VTKIOCORE_EXPORT vtkOutputStream : public vtkObject
23 {
24 public:
25 vtkTypeMacro(vtkOutputStream, vtkObject);
26 static vtkOutputStream* New();
27 void PrintSelf(ostream& os, vtkIndent indent) override;
28
30
33 vtkSetMacro(Stream, ostream*);
34 vtkGetMacro(Stream, ostream*);
36
42 virtual int StartWriting();
43
47 virtual int Write(void const* data, size_t length);
48
55 virtual int EndWriting();
56
57 protected:
58 vtkOutputStream();
59 ~vtkOutputStream() override;
60
61 // The real output stream.
62 ostream* Stream;
63 int WriteStream(const char* data, size_t length);
64
65 private:
66 vtkOutputStream(const vtkOutputStream&) = delete;
67 void operator=(const vtkOutputStream&) = delete;
68 };
69
70 VTK_ABI_NAMESPACE_END
71 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkOutputStream
Wraps a binary output stream with a VTK interface.
Definition: vtkOutputStream.h:23
vtkOutputStream::vtkOutputStream
vtkOutputStream()
vtkOutputStream::StartWriting
virtual int StartWriting()
Called after the stream position has been set by the caller, but before any Write calls.
vtkOutputStream::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOutputStream::WriteStream
int WriteStream(const char *data, size_t length)
vtkOutputStream::New
static vtkOutputStream * New()
vtkOutputStream::Write
virtual int Write(void const *data, size_t length)
Write output data of the given length.
vtkOutputStream::Stream
ostream * Stream
Definition: vtkOutputStream.h:62
vtkOutputStream::EndWriting
virtual int EndWriting()
Called after all desired calls to Write have been made.
vtkOutputStream::~vtkOutputStream
~vtkOutputStream() override
vtkX3D::length
@ length
Definition: vtkX3D.h:393
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkObject.h