ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkFileOutputWindow.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkFileOutputWindow_h
19 #define itkFileOutputWindow_h
20 
21 #include "itkOutputWindow.h"
22 #include "itkObjectFactory.h"
23 #include <fstream>
24 
25 namespace itk
26 {
38 class ITKCommon_EXPORT FileOutputWindow:public OutputWindow
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_ASSIGN(FileOutputWindow);
42 
48 
50  itkNewMacro(Self);
51 
53  itkTypeMacro(FileOutputWindow, OutputWindow);
54 
56  void DisplayText(const char *) override;
57 
59  itkSetStringMacro(FileName);
60 
62  itkGetStringMacro(FileName);
63 
65  itkSetMacro(Flush, bool);
66  itkGetConstMacro(Flush, bool);
67  itkBooleanMacro(Flush);
69 
74  itkSetMacro(Append, bool);
75  itkGetConstMacro(Append, bool);
76  itkBooleanMacro(Append);
78 
79 protected:
81  ~FileOutputWindow() override;
82  void PrintSelf(std::ostream & os, Indent indent) const override;
83 
84  void Initialize();
85 
86  std::ofstream *m_Stream;
87 
88  std::string m_FileName;
89 
90  bool m_Flush;
91  bool m_Append;
92 };
93 } // end namespace itk
94 
95 #endif
Messages sent from the system are collected by this object.
Messages sent from the system are sent to a file.
Control indentation during Print() invocation.
Definition: itkIndent.h:49