freLogFileController.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: freLogFileController.h,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 #ifndef __freLogFileController_h
00023 #define __freLogFileController_h
00024 
00025 #include <fstream>
00026 
00027 #include "freConstantValues.h"
00028 
00029 namespace FREE
00030 {
00031 
00044 class LogFileController
00045 {
00046 public:  
00055   bool StartLog(); 
00056   
00068   bool StartLog(const std::string  sLogFileName); 
00069 
00072   bool StopLog();
00073 
00078   bool Active() const;
00079 
00084   bool AddEntry(const std::string  sEntry);
00085 
00093   bool AddDirectEntry(const std::string  sEntry);
00094   
00106   bool AddEntry(const std::string  sEntry, const bool bAddTimeStamp);
00107 
00114   void SetFileName(const std::string  sFileName);
00117   const std::string  GetFileName() const;
00118 
00121   void SetHeader(const std::string  sHeader);
00124   const std::string  GetHeader() const;
00125 
00129   void SetInsertTimeStamp(const bool bTime);
00132   const bool GetInsertTimeStamp() const;
00133 
00140   void SetAppendFile(const bool bAppend);
00144   const bool GetAppendFile() const;
00145 
00147   LogFileController();
00153   LogFileController(const std::string  sFileName, const std::string  sHeader = "Log file",
00154                                                   const bool bAppend = true, const bool bInsertTime = true);
00155   ~LogFileController();
00156 
00157 private:
00160   bool OpenLogFile();
00163   bool CloseLogFile();
00164 
00167   std::string  m_sFileName;
00168   
00171   std::string  m_sHeader;
00172 
00175   bool m_bActive;
00176 
00179   bool m_bInsertTime;
00180 
00183   bool m_bAppendFile;
00184 
00186   std::ofstream m_LogFile;
00187 };
00188 
00189 }//End of Namespace free
00190 
00191 #endif

Generated at Sat Oct 13 16:25:09 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000