3 #include <ctype.h> // For isspace
9 gdcmDebug::gdcmDebug(int level) {
13 void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2) {
14 if (Level > DebugLevel)
16 cerr << Msg1 << ' ' << Msg2 << '\n';
19 void gdcmDebug::Assert(int Level, bool Test,
20 const char * Msg1, const char * Msg2) {
21 if (Level > DebugLevel)
24 cerr << Msg1 << ' ' << Msg2 << '\n';
27 void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2) {
30 std::cerr << Msg1 << ' ' << Msg2 << '\n';
34 void gdcmDebug::Error(const char* Msg1, const char* Msg2,
36 std::cerr << Msg1 << ' ' << Msg2 << ' ' << Msg3 << '\n';
40 void gdcmDebug::Exit(int a) {
45 exit(a); // Found in #include <stdlib.h>
49 ///////////////////////////////////////////////////////////////////////////
50 gdcmVR * gdcmGlobal::VR = (gdcmVR*)0;
51 gdcmDictSet * gdcmGlobal::Dicts = (gdcmDictSet*)0;
54 gdcmGlobal::gdcmGlobal(void) {
56 dbg.Verbose(0, "gdcmGlobal::gdcmGlobal: VR or Dicts allready allocated");
58 Dicts = new gdcmDictSet();
61 gdcmGlobal::~gdcmGlobal() {
66 gdcmVR * gdcmGlobal::GetVR(void) {
70 gdcmDictSet * gdcmGlobal::GetDicts(void) {
74 ///////////////////////////////////////////////////////////////////////////
75 // Because is not yet available in g++2.96
76 istream& eatwhite(istream& is) {
87 void Tokenize (const string& str,
88 vector<string>& tokens,
89 const string& delimiters) {
90 string::size_type lastPos = str.find_first_not_of(delimiters,0);
91 string::size_type pos = str.find_first_of(delimiters,lastPos);
92 while (string::npos != pos || string::npos != lastPos) {
93 tokens.push_back(str.substr(lastPos, pos - lastPos));
94 lastPos = str.find_first_not_of(delimiters, pos);
95 pos = str.find_first_of(delimiters, lastPos);