3 #include <ctype.h> // For isspace
6 gdcmDebug::gdcmDebug(int level) {
10 void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2) {
11 if (Level > DebugLevel)
13 cerr << Msg1 << ' ' << Msg2 << '\n';
16 void gdcmDebug::Assert(int Level, bool Test,
17 const char * Msg1, const char * Msg2) {
18 if (Level > DebugLevel)
21 cerr << Msg1 << ' ' << Msg2 << '\n';
24 void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2) {
27 std::cerr << Msg1 << ' ' << Msg2 << '\n';
31 void gdcmDebug::Error(const char* Msg1, const char* Msg2,
33 std::cerr << Msg1 << ' ' << Msg2 << ' ' << Msg3 << '\n';
37 void gdcmDebug::Exit(int a) {
42 exit(a); // Found in #include <stdlib.h>
48 // Because is not yet available in g++2.96
49 istream& eatwhite(istream& is) {
60 void Tokenize (const string& str,
61 vector<string>& tokens,
62 const string& delimiters) {
63 string::size_type lastPos = str.find_first_not_of(delimiters,0);
64 string::size_type pos = str.find_first_of(delimiters,lastPos);
65 while (string::npos != pos || string::npos != lastPos) {
66 tokens.push_back(str.substr(lastPos, pos - lastPos));
67 lastPos = str.find_first_not_of(delimiters, pos);
68 pos = str.find_first_of(delimiters, lastPos);