VTK  9.3.20240418
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 
19 VTK_ABI_NAMESPACE_BEGIN
20 class VTKCOMMONCORE_EXPORT vtkStringOutputWindow : public vtkOutputWindow
21 {
22 public:
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 
40 protected:
43  void Initialize();
44 
45  std::ostringstream OStream;
46 
47 private:
49  void operator=(const vtkStringOutputWindow&) = delete;
50 };
51 
52 VTK_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.
std::ostringstream OStream
@ string
Definition: vtkX3D.h:490