}
//-----------------------------------------------------------------------------
-gdcmVR * gdcmGlobal::VR = (gdcmVR*)0;
-gdcmTS * gdcmGlobal::TS = (gdcmTS*)0;
-gdcmDictSet * gdcmGlobal::Dicts = (gdcmDictSet*)0;
+gdcmDictSet *gdcmGlobal::Dicts = (gdcmDictSet *)0;
+gdcmVR *gdcmGlobal::VR = (gdcmVR *)0;
+gdcmTS *gdcmGlobal::TS = (gdcmTS *)0;
+gdcmDicomDirElement *gdcmGlobal::ddElem = (gdcmDicomDirElement *)0;
gdcmGlobal gdcmGlob;
gdcmGlobal::gdcmGlobal(void) {
if (VR || TS || Dicts)
dbg.Verbose(0, "gdcmGlobal::gdcmGlobal : VR or TS or Dicts already allocated");
+ Dicts = new gdcmDictSet();
VR = new gdcmVR();
TS = new gdcmTS();
- Dicts = new gdcmDictSet();
+ ddElem = new gdcmDicomDirElement();
}
gdcmGlobal::~gdcmGlobal() {
+ delete Dicts;
delete VR;
delete TS;
- delete Dicts;
+ delete ddElem;
}
-gdcmVR * gdcmGlobal::GetVR(void) {
+gdcmVR *gdcmGlobal::GetVR(void) {
return VR;
}
-gdcmTS * gdcmGlobal::GetTS(void) {
+gdcmTS *gdcmGlobal::GetTS(void) {
return TS;
}
-gdcmDictSet * gdcmGlobal::GetDicts(void) {
+gdcmDictSet *gdcmGlobal::GetDicts(void) {
return Dicts;
}
+gdcmDicomDirElement *gdcmGlobal::GetDicomDirElements(void) {
+ return ddElem;
+}
+
//-----------------------------------------------------------------------------
// Because is not yet available in g++2.96
std::istream& eatwhite(std::istream& is) {
///////////////////////////////////////////////////////////////////////////
// to prevent a flashing screen when non-printable character
-char * _cleanString(char *v) {
+char *_cleanString(char *v) {
char *d;
int i, l;
l = strlen(v);
for (i=0,d=v;
- i<l ;
- i++,d++) {
- if (!isprint(*d))
+ i<l ;
+ i++,d++) {
+ if (!isprint(*d))
*d = '.';
- }
+ }
return v;
}
///////////////////////////////////////////////////////////////////////////
// to prevent a flashing screen when non-printable character
std::string _CreateCleanString(std::string s) {
- std::string str=s;
- for(int i=0;i<str.size();i++)
- {
- if(!isprint(str[i]))
- str[i]='.';
- }
+ std::string str=s;
+
+ for(int i=0;i<str.size();i++)
+ {
+ if(!isprint(str[i]))
+ str[i]='.';
+ }
- return(str);
-}
+ if(str.size()>0)
+ if(!isprint(s[str.size()-1]))
+ if(s[str.size()-1]==0)
+ str[str.size()-1]=' ';
+
+ return(str);
+}