X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmContentEntry.cxx;h=97c949e9bb62358f9f1a2a2be82c874cad54e7dc;hb=8ba6105c39056bba295025f4b46d2cdf24dab792;hp=c09cfb787b8fd286d20d138a04965e0a01746247;hpb=b616acd3a7a3dc34524e9f2482d70b25a6e1beff;p=gdcm.git diff --git a/src/gdcmContentEntry.cxx b/src/gdcmContentEntry.cxx index c09cfb78..97c949e9 100644 --- a/src/gdcmContentEntry.cxx +++ b/src/gdcmContentEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmContentEntry.cxx,v $ Language: C++ - Date: $Date: 2005/01/26 09:49:53 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/06/24 10:55:58 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -34,7 +34,8 @@ namespace gdcm * \brief Constructor for a given DictEntry * @param e Pointer to existing dictionary entry */ -ContentEntry::ContentEntry(DictEntry *e) : DocEntry(e) +ContentEntry::ContentEntry(DictEntry *e) + : DocEntry(e) { Value = GDCM_UNFOUND; } @@ -44,12 +45,11 @@ ContentEntry::ContentEntry(DictEntry *e) : DocEntry(e) * @param e Pointer to existing Doc entry */ ContentEntry::ContentEntry(DocEntry *e) - : DocEntry(e->GetDictEntry()) + : DocEntry(e->GetDictEntry()) { Copy(e); } - /** * \brief Canonical destructor. */ @@ -58,61 +58,18 @@ ContentEntry::~ContentEntry () } //----------------------------------------------------------------------------- -// Public +// Print -/** - * \brief Writes the 'std::string representable' value of a ContentEntry - * @param fp already open ofstream pointer - * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...) - */ -void ContentEntry::WriteContent(std::ofstream *fp, FileType filetype) +//----------------------------------------------------------------------------- +// Public +void ContentEntry::Copy(DocEntry *doc) { - DocEntry::WriteContent(fp, filetype); - - if ( GetGroup() == 0xfffe ) - { - return; //delimitors have NO value - } + DocEntry::Copy(doc); - const VRKey &vr = GetVR(); - unsigned int lgr = GetLength(); - if (vr == "US" || vr == "SS") - { - // some 'Short integer' fields may be multivaluated - // each single value is separated from the next one by '\' - // we split the string and write each value as a short int - std::vector tokens; - tokens.erase(tokens.begin(),tokens.end()); // clean any previous value - Util::Tokenize (GetValue(), tokens, "\\"); - for (unsigned int i=0; i tokens; - tokens.erase(tokens.begin(),tokens.end()); // clean any previous value - Util::Tokenize (GetValue(), tokens, "\\"); - for (unsigned int i=0; i(doc); + if ( entry ) + Value = entry->Value; +} //----------------------------------------------------------------------------- // Protected