VTK  9.1.0
vtkOutputStream.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkOutputStream.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 vtkOutputStream_h
28#define vtkOutputStream_h
29
30#include "vtkIOCoreModule.h" // For export macro
31#include "vtkObject.h"
32
33class VTKIOCORE_EXPORT vtkOutputStream : public vtkObject
34{
35public:
36 vtkTypeMacro(vtkOutputStream, vtkObject);
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
41
44 vtkSetMacro(Stream, ostream*);
45 vtkGetMacro(Stream, ostream*);
47
53 virtual int StartWriting();
54
58 virtual int Write(void const* data, size_t length);
59
66 virtual int EndWriting();
67
68protected:
70 ~vtkOutputStream() override;
71
72 // The real output stream.
73 ostream* Stream;
74 int WriteStream(const char* data, size_t length);
75
76private:
77 vtkOutputStream(const vtkOutputStream&) = delete;
78 void operator=(const vtkOutputStream&) = delete;
79};
80
81#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
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
@ length
Definition: vtkX3D.h:399
@ data
Definition: vtkX3D.h:321