VTK
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 
31 class VTKCOMMONCORE_EXPORT vtkStringOutputWindow : public vtkOutputWindow
32 {
33 public:
35 
36  static vtkStringOutputWindow* New();
37 
38  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
39 
44  void DisplayText(const char*) VTK_OVERRIDE;
45 
49  std::string GetOutput() { return this->OStream.str(); };
50 
51 protected:
53  ~vtkStringOutputWindow() VTK_OVERRIDE;
54  void Initialize();
55 
56  std::ostringstream OStream;
57 
58 private:
59  vtkStringOutputWindow(const vtkStringOutputWindow&) VTK_DELETE_FUNCTION;
60  void operator=(const vtkStringOutputWindow&) VTK_DELETE_FUNCTION;
61 };
62 
63 
64 #endif
virtual void DisplayText(const char *)
Display the text.
static vtkOutputWindow * New()
This is a singleton pattern New.
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Print ObjectFactor to stream.
base class for writing debug output to a console
File Specific output window class.