]> Creatis software - gdcm.git/blob - src/gdcmDebug.h
* src/gdcmCommon.h, gdcmDict.cxx, gdcmTS.cxx : bug fix for msvc6 compilation
[gdcm.git] / src / gdcmDebug.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDebug.h,v $
5   Language:  C++
6   Date:      $Date: 2004/07/19 11:51:26 $
7   Version:   $Revision: 1.4 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMDEBUG_H
20 #define GDCMDEBUG_H
21
22 #include "gdcmCommon.h"
23
24 //-----------------------------------------------------------------------------
25 #define dbg gdcmDebug::GetReference()
26
27 //-----------------------------------------------------------------------------
28
29 /**
30  * \ingroup gdcmDebug
31  * \brief gdcmDebug is an object for debugging in program.
32  * It has 2 debugging modes :
33  *  - error : for bad library use
34  *  - debug : for debugging messages
35  * 
36  * A debugging message has a level of priority and is 
37  * Shown only when the debug level is higher than the 
38  * message level.
39  */
40 class GDCM_EXPORT gdcmDebug {
41 public:
42    gdcmDebug(int level = -1);
43
44    void SetDebug (int level);
45    void Verbose(int, const char*, const char* ="");
46    void Error(bool, const char*,  const char* ="");
47    void Error(const char*, const char* ="", const char* ="");
48
49    void Assert(int, bool, const char*, const char*);
50    void Exit(int);
51
52    static gdcmDebug &GetReference();
53
54 private:
55 /// warning message level to be displayed
56    int DebugLevel;
57
58 /// Instance of debugging utility.
59    static gdcmDebug debug;
60 };
61
62 #endif