Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

gdcm::Debug Class Reference

Debug is an object for debugging in program. It has 2 debugging modes : -error : for bad library use, seriously wrong DICOM -debug : for information/debug messages -warning : for warning about DICOM quality (kosher). More...

#include <gdcmDebug.h>

List of all members.

Public Member Functions

 Debug ()
 ~Debug ()

Static Public Member Functions

void SetDebugFlag (bool flag)
 Sets the debug flag.

bool GetDebugFlag ()
 Gets the debug flag value.

void DebugOn ()
 Sets the Debug Flag to true.

void DebugOff ()
 Sets the Debug Flag to false.

void SetDebugToFile (bool flag)
 Accessor.

bool GetDebugToFile ()
 Accessor to know if debug info are redirected to file.

void DebugToFileOn ()
 Next debug messages will be sent in the debug file.

void DebugToFileOff ()
 Next debug messages will be sent in the standard output.

void SetDebugFilename (std::string const &filename)
 Set the filename the debug stream should be redirect to Settting a filename also set DebugToFile to true.

std::ofstream & GetDebugFile ()
 Internal use only. Allow us to retrieve the static from anywhere in gdcm code.


Detailed Description

Debug is an object for debugging in program. It has 2 debugging modes : -error : for bad library use, seriously wrong DICOM -debug : for information/debug messages -warning : for warning about DICOM quality (kosher).

A debugging message is only show if the flag is on (DebugFlag) This is static var and can be set at beginning of code: gdcm::Debug::SetDebugOn();

Definition at line 44 of file gdcmDebug.h.


Constructor & Destructor Documentation

gdcm::Debug::Debug  ) 
 

Definition at line 32 of file gdcmDebug.cxx.

00033 {
00034 
00035 }

gdcm::Debug::~Debug  ) 
 

Definition at line 37 of file gdcmDebug.cxx.

References gdcm::DebugFile.

00038 {
00039   if ( DebugFile.is_open() )
00040       DebugFile.close();     
00041 }


Member Function Documentation

void gdcm::Debug::DebugOff  )  [inline, static]
 

Sets the Debug Flag to false.

Definition at line 57 of file gdcmDebug.h.

00057 { SetDebugFlag(false); };

void gdcm::Debug::DebugOn  )  [inline, static]
 

Sets the Debug Flag to true.

Definition at line 55 of file gdcmDebug.h.

00055 { SetDebugFlag(true);  };

void gdcm::Debug::DebugToFileOff  )  [inline, static]
 

Next debug messages will be sent in the standard output.

Definition at line 66 of file gdcmDebug.h.

00066 { SetDebugToFile(false); };

void gdcm::Debug::DebugToFileOn  )  [inline, static]
 

Next debug messages will be sent in the debug file.

Definition at line 64 of file gdcmDebug.h.

00064 { SetDebugToFile(true);  };

std::ofstream & gdcm::Debug::GetDebugFile  )  [static]
 

Internal use only. Allow us to retrieve the static from anywhere in gdcm code.

Returns:
Debug file

Definition at line 101 of file gdcmDebug.cxx.

References gdcm::DebugFile.

00102 {
00103   return DebugFile;
00104 }

bool gdcm::Debug::GetDebugFlag  )  [static]
 

Gets the debug flag value.

Returns:
debug flag value

Definition at line 58 of file gdcmDebug.cxx.

References gdcm::DebugFlag.

00059 {
00060    return DebugFlag;
00061 }

bool gdcm::Debug::GetDebugToFile  )  [static]
 

Accessor to know if debug info are redirected to file.

Definition at line 75 of file gdcmDebug.cxx.

References gdcm::DebugToFile.

00076 {
00077    return DebugToFile;
00078 }

void gdcm::Debug::SetDebugFilename std::string const &  filename  )  [static]
 

Set the filename the debug stream should be redirect to Settting a filename also set DebugToFile to true.

Parameters:
filename File to redirect debug info Absolutely nothing is check. You have to pass in a correct filename

Definition at line 87 of file gdcmDebug.cxx.

References gdcm::DebugFile, gdcm::DebugFlag, and gdcm::DebugToFile.

00088 {
00089    DebugToFile = true;  // Just in case ... 
00090    DebugFlag = true;    // Just in case ...
00091    if( DebugFile.is_open() )
00092       DebugFile.close();
00093    DebugFile.open( filename.c_str() );
00094 }

void gdcm::Debug::SetDebugFlag bool  flag  )  [static]
 

Sets the debug flag.

This is a global flag that controls whether any debug, warning messages are displayed.

Definition at line 49 of file gdcmDebug.cxx.

References gdcm::DebugFlag.

00050 {
00051    DebugFlag = flag;
00052 }

void gdcm::Debug::SetDebugToFile bool  flag  )  [static]
 

Accessor.

This is a global flag that controls if debug are redirected to a file or not

Definition at line 67 of file gdcmDebug.cxx.

References gdcm::DebugToFile.

00068 {
00069    DebugToFile = flag;
00070 }


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 22:18:05 2005 for gdcm by doxygen 1.3.6