00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkFileOutputWindow.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-04-25 12:24:06 $ 00007 Version: $Revision: 1.11 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkFileOutputWindow_h 00018 #define __itkFileOutputWindow_h 00019 00020 #include "itkOutputWindow.h" 00021 #include "itkObjectFactory.h" 00022 #include <fstream> 00023 00024 namespace itk 00025 { 00036 class ITKCommon_EXPORT FileOutputWindow : public OutputWindow 00037 { 00038 public: 00040 typedef FileOutputWindow Self; 00041 typedef OutputWindow Superclass; 00042 typedef SmartPointer<Self> Pointer; 00043 typedef SmartPointer<const Self> ConstPointer; 00044 00046 itkNewMacro(Self); 00047 00049 itkTypeMacro(FileOutputWindow, OutputWindow); 00050 00052 virtual void DisplayText(const char*); 00053 00055 itkSetStringMacro(FileName); 00056 00058 itkGetStringMacro(FileName); 00059 00061 itkSetMacro(Flush,bool); 00062 itkGetConstMacro(Flush,bool); 00063 itkBooleanMacro(Flush); 00065 00070 itkSetMacro(Append, bool); 00071 itkGetConstMacro(Append, bool); 00072 itkBooleanMacro(Append); 00074 00075 protected: 00076 FileOutputWindow(); 00077 virtual ~FileOutputWindow(); 00078 virtual void PrintSelf(std::ostream& os, Indent indent) const; 00079 void Initialize(); 00080 00081 std::ofstream * m_Stream; 00082 std::string m_FileName; 00083 bool m_Flush; 00084 bool m_Append; 00085 00086 private: 00087 FileOutputWindow(const Self&); //purposely not implemented 00088 void operator=(const Self&); //purposely not implemented 00089 00090 }; 00091 00092 } // end namespace itk 00093 00094 #endif 00095