VTK  9.1.0
vtkStringOutputWindow.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkStringOutputWindow.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=========================================================================*/
24#ifndef vtkStringOutputWindow_h
25#define vtkStringOutputWindow_h
26
27#include "vtkCommonCoreModule.h" // For export macro
28#include "vtkOutputWindow.h"
29#include <sstream> // for ivar
30
31class VTKCOMMONCORE_EXPORT vtkStringOutputWindow : public vtkOutputWindow
32{
33public:
35
37
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
44 void DisplayText(const char*) override;
45
49 std::string GetOutput() { return this->OStream.str(); }
50
51protected:
54 void Initialize();
55
56 std::ostringstream OStream;
57
58private:
60 void operator=(const vtkStringOutputWindow&) = delete;
61};
62
63#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
base class for writing debug output to a console
File Specific output window class.
~vtkStringOutputWindow() override
void DisplayText(const char *) override
Put the text into the log file.
static vtkStringOutputWindow * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Print ObjectFactor to stream.
std::string GetOutput()
Get the current output as a string.
std::ostringstream OStream