Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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 : More...

#include <gdcmDebug.h>

List of all members.

Public Member Functions

 Debug ()
 ~Debug ()

Static Public Member Functions

static void SetDebugFlag (bool flag)
 Sets both the debug flag and warning flag (both used for debugging purpose).
static bool GetDebugFlag ()
 Gets the debug flag value (used to warn user when file contains some oddity).
static void DebugOn ()
 Sets the Debug Flag to true.
static void DebugOff ()
 Sets the Debug Flag to false.
static void SetWarningFlag (bool flag)
 Sets the warning flag.
static bool GetWarningFlag ()
 Gets the warning flag value.
static void WarningOn ()
 Sets the Warning Flag to true.
static void WarningOff ()
 Sets the Warning Flag to false.
static void SetDebugToFile (bool flag)
 Accessor.
static bool GetDebugToFile ()
 Accessor to know whether debug info are redirected to file.
static void DebugToFileOn ()
 Next debug messages will be sent in the debug file.
static void DebugToFileOff ()
 Next debug messages will be sent in the standard output.
static void SetDebugFilename (std::string const &filename)
 Set the filename the debug stream should be redirect to Settting a filename also sets DebugToFile to true.
static 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 :

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

Definition at line 48 of file gdcmDebug.h.


Constructor & Destructor Documentation

gdcm::Debug::Debug  ) 
 

Definition at line 33 of file gdcmDebug.cxx.

00034 {
00035 
00036 }

gdcm::Debug::~Debug  ) 
 

Definition at line 38 of file gdcmDebug.cxx.

References gdcm::DebugFile.

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


Member Function Documentation

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

Sets the Debug Flag to false.

Definition at line 61 of file gdcmDebug.h.

00061 { SetDebugFlag(false); }

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

Sets the Debug Flag to true.

Definition at line 59 of file gdcmDebug.h.

00059 { SetDebugFlag(true);  }

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

Next debug messages will be sent in the standard output.

Definition at line 79 of file gdcmDebug.h.

00079 { SetDebugToFile(false); }

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

Next debug messages will be sent in the debug file.

Definition at line 77 of file gdcmDebug.h.

00077 { 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 126 of file gdcmDebug.cxx.

References gdcm::DebugFile.

00127 {
00128   return DebugFile;
00129 }

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

Gets the debug flag value (used to warn user when file contains some oddity).

Returns:
debug flag value

Definition at line 63 of file gdcmDebug.cxx.

References gdcm::DebugFlag.

Referenced by gdcm::Document::ParseDES().

00064 {
00065    return DebugFlag;
00066 }

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

Accessor to know whether debug info are redirected to file.

Definition at line 100 of file gdcmDebug.cxx.

References gdcm::DebugToFile.

00101 {
00102    return DebugToFile;
00103 }

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

Gets the warning flag value.

Returns:
warning flag value

Definition at line 84 of file gdcmDebug.cxx.

References gdcm::WarningFlag.

00085 {
00086    return WarningFlag;
00087 }

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

Set the filename the debug stream should be redirect to Settting a filename also sets 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 112 of file gdcmDebug.cxx.

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

00113 {
00114    DebugToFile = true;  // Just in case ... 
00115    DebugFlag   = true;  // Just in case ...
00116    if ( DebugFile.is_open() )
00117       DebugFile.close();
00118    DebugFile.open( filename.c_str() );
00119 }

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

Sets both the debug flag and warning flag (both used for debugging purpose).

Parameters:
flag Set the debug flag and warning flag

Definition at line 51 of file gdcmDebug.cxx.

References gdcm::DebugFlag, and gdcm::WarningFlag.

00052 {
00053    // To help tracking a bug, both flags are necessary
00054    DebugFlag   = flag;
00055    WarningFlag = flag;
00056 }

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

Accessor.

Parameters:
flag whether we want to redirect to file

Definition at line 92 of file gdcmDebug.cxx.

References gdcm::DebugToFile.

00093 {
00094    DebugToFile = flag;
00095 }

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

Sets the warning flag.

Parameters:
flag Set the warning flag

Definition at line 72 of file gdcmDebug.cxx.

References gdcm::DebugFlag, and gdcm::WarningFlag.

00073 {
00074    // Cannot unset Warning flag if Debug flag is on.
00075    if (flag == false && DebugFlag == true)
00076       return;
00077    WarningFlag = flag;
00078 }

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

Sets the Warning Flag to false.

Definition at line 70 of file gdcmDebug.h.

00070 { SetWarningFlag(false); }   

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

Sets the Warning Flag to true.

Definition at line 68 of file gdcmDebug.h.

00068 { SetWarningFlag(true);  }


The documentation for this class was generated from the following files:
Generated on Fri Nov 18 15:58:05 2005 for gdcm by  doxygen 1.4.4