VTK  9.4.20241108
vtkStringOutputWindow.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
12#ifndef vtkStringOutputWindow_h
13#define vtkStringOutputWindow_h
14
15#include "vtkCommonCoreModule.h" // For export macro
16#include "vtkOutputWindow.h"
17#include <sstream> // for ivar
18
19VTK_ABI_NAMESPACE_BEGIN
20class VTKCOMMONCORE_EXPORT vtkStringOutputWindow : public vtkOutputWindow
21{
22public:
24
26
27 void PrintSelf(ostream& os, vtkIndent indent) override;
28
33 void DisplayText(const char*) override;
34
38 std::string GetOutput() { return this->OStream.str(); }
39
40protected:
43 void Initialize();
44
45 std::ostringstream OStream;
46
47private:
49 void operator=(const vtkStringOutputWindow&) = delete;
50};
51
52VTK_ABI_NAMESPACE_END
53#endif
a simple class to control print indentation
Definition vtkIndent.h:108
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.