X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmHeaderEntry.cxx;h=3c2ffaf7601f9e34827341f62d141efd174348b2;hb=8402492c91eb411888fb7e220e0f02b3d94c59db;hp=e53120744a3385ac0f75921753cd04a5ca6439f3;hpb=8d4184fc7129f85d9ec384a3c7b9c5928a1f5b5e;p=gdcm.git diff --git a/src/gdcmHeaderEntry.cxx b/src/gdcmHeaderEntry.cxx index e5312074..3c2ffaf7 100644 --- a/src/gdcmHeaderEntry.cxx +++ b/src/gdcmHeaderEntry.cxx @@ -13,6 +13,9 @@ #endif #include // for std::ios::left, ... + +#define MAX_SIZE_PRINT_ELEMENT_VALUE 64 + //----------------------------------------------------------------------------- // Constructor / Destructor /** @@ -22,6 +25,7 @@ */ gdcmHeaderEntry::gdcmHeaderEntry(gdcmDictEntry* in) { ImplicitVR = false; + voidArea = NULL; // unsecure memory area to hold 'non string' values entry = in; } @@ -48,7 +52,7 @@ void gdcmHeaderEntry::Print(std::ostream & os) { d2 = _CreateCleanString(v); // replace non printable characters by '.' if (printLevel>=2) { s << "lg : "; - lgth = GetReadLength(); + lgth = GetReadLength(); // ReadLength, as opposed to UsableLength if (lgth == 0xffffffff) { sprintf(st,"x(ffff)"); // I said : "x(ffff)" ! s.setf(std::ios::left); @@ -76,14 +80,24 @@ void gdcmHeaderEntry::Print(std::ostream & os) { if (printLevel>=1) { s.setf(std::ios::left); s << std::setw(66-GetName().length()) << " "; - } - - s << "[" << GetName()<< "]"; - if( (GetLength()<64) || (printLevel>=3) ) - s << " [" << d2 << "]"; - else - s << " [ gdcm::too long for print (" << GetLength() << ") ]"; + } + + s << "[" << GetName()<< "]"; + if (voidArea != NULL) { + s << " [gdcm::Non String Data Loaded in Unsecure Area (" + << GetLength() << ") ]"; + } + + else { + if( (GetLength()=3) || + (d2.find("gdcm::NotLoaded.") < d2.length()) ) + s << " [" << d2 << "]"; + else + s << " [gdcm::too long for print (" << GetLength() << ") ]"; + } + // Display the UID value (instead of displaying the rough code) if (g == 0x0002) { // Any more to be displayed ? if ( (e == 0x0010) || (e == 0x0002) )