X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmUtil.cxx;h=faad02548843d592f30abff1a2bfc3bdb439a2f2;hb=a23d3b0e36743664f22f42269224f305ccf50fdb;hp=40143310270811fa753301afa7bf6ac6663befc2;hpb=06c1c583239fdf5196260e6ef83a78669c1bd17f;p=gdcm.git diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 40143310..faad0254 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -52,37 +52,44 @@ 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) { +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) { @@ -113,16 +120,16 @@ void Tokenize (const std::string& str, /////////////////////////////////////////////////////////////////////////// // 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; - i0) + if(!isprint(s[str.size()-1])) + if(s[str.size()-1]==0) + str[str.size()-1]=' '; + + return(str); +}