]> Creatis software - gdcm.git/blob - src/gdcmUtil.h
* src/*.h : add comments
[gdcm.git] / src / gdcmUtil.h
1 // $Header: /cvs/public/gdcm/src/gdcmUtil.h,v 1.17 2004/01/12 13:12:28 regrain Exp $
2
3 #ifndef GDCMUTIL_H
4 #define GDCMUTIL_H
5
6 #include "gdcmVR.h"
7 #include "gdcmTS.h"
8 #include "gdcmDictSet.h"
9 #include <iostream>
10 #include <vector>
11 #include <string>
12
13 /*
14  * gdcmDebug is an object for debugging in program.
15  * It has 2 debugging modes :
16  *  - error : for bad library use
17  *  - debug : for debugging messages
18  * 
19  * A debugging message has a level of priority and is 
20  * Shown only when the debug level is higher than the 
21  * message level.
22  */
23 class gdcmDebug {
24 private:
25         int DebugLevel;
26 public:
27         gdcmDebug(int  = 0);
28         void Verbose(int, const char*, const char* ="");
29         void Error(bool, const char*,  const char* ="");
30         void Error(const char*, const char* ="", const char* ="");
31         void Assert(int, bool, const char*, const char*);
32         void Exit(int);
33         void SetDebug (int i) {DebugLevel = i;}
34 };
35
36 /*
37  * This class contains all globals elements that might be
38  * instanciated only one time
39  */
40 class gdcmGlobal {
41 private:
42    static gdcmVR *VR;
43    static gdcmTS *TS; 
44    static gdcmDictSet *Dicts; 
45 public:
46    gdcmGlobal(void);
47    ~gdcmGlobal();
48    static gdcmVR * GetVR(void);
49    static gdcmTS * GetTS(void);
50    static gdcmDictSet * GetDicts(void);
51 };
52
53 std::istream & eatwhite(std::istream & is);
54
55 void Tokenize (const std::string& str,
56                std::vector<std::string>& tokens,
57                const std::string& delimiters = " ");
58
59 extern gdcmDebug dbg;
60
61 char * _cleanString(char *v);
62 std::string _CreateCleanString(std::string s);
63
64 std::string TranslateToKey(guint16 group, guint16 element);
65
66 #endif
67