3 #include <ctype.h> // For isspace
8 gdcmVR * gdcmGlobal::VR = new gdcmVR();
10 gdcmDebug::gdcmDebug(int level) {
14 void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2) {
15 if (Level > DebugLevel)
17 cerr << Msg1 << ' ' << Msg2 << '\n';
20 void gdcmDebug::Assert(int Level, bool Test,
21 const char * Msg1, const char * Msg2) {
22 if (Level > DebugLevel)
25 cerr << Msg1 << ' ' << Msg2 << '\n';
28 void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2) {
31 std::cerr << Msg1 << ' ' << Msg2 << '\n';
35 void gdcmDebug::Error(const char* Msg1, const char* Msg2,
37 std::cerr << Msg1 << ' ' << Msg2 << ' ' << Msg3 << '\n';
41 void gdcmDebug::Exit(int a) {
46 exit(a); // Found in #include <stdlib.h>
50 ///////////////////////////////////////////////////////////////////////////
51 gdcmGlobal::gdcmGlobal(void) {
54 gdcmGlobal::~gdcmGlobal(void) {
58 gdcmVR * gdcmGlobal::GetVR(void) {
62 ///////////////////////////////////////////////////////////////////////////
63 // Because is not yet available in g++2.96
64 istream& eatwhite(istream& is) {
75 void Tokenize (const string& str,
76 vector<string>& tokens,
77 const string& delimiters) {
78 string::size_type lastPos = str.find_first_not_of(delimiters,0);
79 string::size_type pos = str.find_first_of(delimiters,lastPos);
80 while (string::npos != pos || string::npos != lastPos) {
81 tokens.push_back(str.substr(lastPos, pos - lastPos));
82 lastPos = str.find_first_not_of(delimiters, pos);
83 pos = str.find_first_of(delimiters, lastPos);