X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmUtil.cxx;h=faad02548843d592f30abff1a2bfc3bdb439a2f2;hb=7b8dcad5fbb9b248952ad6819ef984e7880ef81e;hp=b642db190e39a3950a25123f7b6e4b27e2f6d39c;hpb=d7a4d5d474ae599b723e52ebda8bd3fc6cee752a;p=gdcm.git diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index b642db19..faad0254 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -52,23 +52,26 @@ void gdcmDebug::Exit(int a) { } //----------------------------------------------------------------------------- -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) { @@ -83,6 +86,10 @@ 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) { @@ -118,11 +125,11 @@ char *_cleanString(char *v) { int i, l; l = strlen(v); for (i=0,d=v; - i0) + if(!isprint(s[str.size()-1])) + if(s[str.size()-1]==0) + str[str.size()-1]=' '; + + return(str); +}