X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDebug.cxx;h=d9a56182e30bb7fcb0ff5bb45e77f96f129570ae;hb=4297b237d3010e089a89e0242d4151168553778f;hp=41f6f18cbb5a5301ecdc126b7ba39eefe9ce2f6b;hpb=c67ffef593e7635d8dfa7d3fe63d702e5afafc3e;p=gdcm.git diff --git a/src/gdcmDebug.cxx b/src/gdcmDebug.cxx index 41f6f18c..d9a56182 100644 --- a/src/gdcmDebug.cxx +++ b/src/gdcmDebug.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDebug.cxx,v $ Language: C++ - Date: $Date: 2005/01/27 11:55:57 $ - Version: $Revision: 1.18 $ + Date: $Date: 2005/06/24 10:55:58 $ + Version: $Revision: 1.25 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,13 +21,14 @@ namespace gdcm { - -/// warning message level to be displayed +//----------------------------------------------------------------------------- +// Warning message level to be displayed static bool DebugFlag = false; static bool DebugToFile = false; static std::ofstream DebugFile; - +//----------------------------------------------------------------------------- +// Constructor / Destructor Debug::Debug() { @@ -38,9 +39,11 @@ Debug::~Debug() if ( DebugFile.is_open() ) DebugFile.close(); } + //----------------------------------------------------------------------------- +// Public /** - * \brief Accessor + * \brief Sets the debug flag * @param flag Set the debug flag */ void Debug::SetDebugFlag (bool flag) @@ -49,8 +52,8 @@ void Debug::SetDebugFlag (bool flag) } /** - * \brief Accessor - * @param level Get the debug flag + * \brief Gets the debug flag value + * @return debug flag value */ bool Debug::GetDebugFlag () { @@ -59,7 +62,7 @@ bool Debug::GetDebugFlag () /** * \brief Accessor - * @param flag Set the debug flag to redirect to file + * @param flag whether we want to redirect to file */ void Debug::SetDebugToFile (bool flag) { @@ -67,8 +70,7 @@ void Debug::SetDebugToFile (bool flag) } /** - * \brief Accessor - * @param level Get the debug flag to redirect to file + * \brief Accessor to know whether debug info are redirected to file */ bool Debug::GetDebugToFile () { @@ -76,25 +78,39 @@ bool Debug::GetDebugToFile () } /** - * \brief Accessor - * @param flag Set the debug flag to redirect to file + * \brief Set the filename the debug stream should be redirect to + * Settting a filename also sets DebugToFile to true + * @param filename File to redirect debug info * Absolutely nothing is check. You have to pass in * a correct filename */ void Debug::SetDebugFilename (std::string const &filename) { DebugToFile = true; // Just in case ... - DebugFlag = true; // Just in case ... - if( DebugFile.is_open() ) + DebugFlag = true; // Just in case ... + if ( DebugFile.is_open() ) DebugFile.close(); DebugFile.open( filename.c_str() ); } +/** + * \brief Internal use only. Allow us to retrieve the static from anywhere + * in gdcm code + * @return Debug file + */ std::ofstream &Debug::GetDebugFile () { return DebugFile; } -} // end namespace gdcm +//----------------------------------------------------------------------------- +// Protected +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print +//----------------------------------------------------------------------------- +} // end namespace gdcm