X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src2%2FcreaImageIOTreeAttributeDescriptor.cpp;h=34647974489a1cb26156579808d0dd5435256f29;hb=b0bee282f8a6c60d5d86495b9bdbc0b89309bf1f;hp=f01e26000b1b1c6a6cf9b0946c54b04facc77a28;hpb=cbf693fa62cd51f4ca5c881838bbb609edc447b0;p=creaImageIO.git diff --git a/src2/creaImageIOTreeAttributeDescriptor.cpp b/src2/creaImageIOTreeAttributeDescriptor.cpp index f01e260..3464797 100644 --- a/src2/creaImageIOTreeAttributeDescriptor.cpp +++ b/src2/creaImageIOTreeAttributeDescriptor.cpp @@ -1,42 +1,155 @@ #include +#include #include #include +#include + namespace creaImageIO { namespace tree { + //======================================================================== + void AttributeDescriptor::CleanName(std::string& str) const + { + // quote must be doubled for SQL + // crea::Utils::Replace( str, "'", "''" ); + boost::algorithm::replace_all(str,"'","''"); + // Found strange strings which contained NULL char INSIDE string + int i,size=str.size(); + for (i=0;iGetDefaultPubDict()->GetEntry(mGroup,mElement); + + if (entry) { - // Decode group & elem - sscanf(key.c_str(),"%04x|%04x",&mGroup,&mElement); - // Retrieve the name from gdcm dict - GDCM_NAME_SPACE::DictEntry* entry = - GDCM_NAME_SPACE::Global::GetDicts() - ->GetDefaultPubDict()->GetEntry(mGroup,mElement); mName = entry->GetName(); + CleanName(mName); + GimmickDebugMessage(3,"='"<GetDefaultPubDict()->GetEntry(GetGroup(),GetElement()); + std::string type = entry->GetVR().str(); + GimmickDebugMessage(3,"VR Value is "<