VTK  9.4.20250114
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
21VTK_ABI_NAMESPACE_BEGIN
22class VTKIOCORE_EXPORT vtkOutputStream : public vtkObject
23{
24public:
25 vtkTypeMacro(vtkOutputStream, vtkObject);
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
57protected:
59 ~vtkOutputStream() override;
60
61 // The real output stream.
62 ostream* Stream;
63 int WriteStream(const char* data, size_t length);
64
65private:
66 vtkOutputStream(const vtkOutputStream&) = delete;
67 void operator=(const vtkOutputStream&) = delete;
68};
69
70VTK_ABI_NAMESPACE_END
71#endif
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Wraps a binary output stream with a VTK interface.
static vtkOutputStream * New()
virtual int StartWriting()
Called after the stream position has been set by the caller, but before any Write calls.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int WriteStream(const char *data, size_t length)
virtual int Write(void const *data, size_t length)
Write output data of the given length.
virtual int EndWriting()
Called after all desired calls to Write have been made.
~vtkOutputStream() override