X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmValEntry.cxx;h=673f9489ae023b6bdfbc1f2adc003998d0264af6;hb=c0ee8512e46a41857db79dd156c16d668cb0d34b;hp=6293e5dc73b0740748ddeac3574a5a71fe95a1eb;hpb=559c3639fc5b255b36a951f352db1addead9f78f;p=gdcm.git diff --git a/src/gdcmValEntry.cxx b/src/gdcmValEntry.cxx index 6293e5dc..673f9489 100644 --- a/src/gdcmValEntry.cxx +++ b/src/gdcmValEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmValEntry.cxx,v $ Language: C++ - Date: $Date: 2004/11/03 20:52:13 $ - Version: $Revision: 1.32 $ + Date: $Date: 2004/11/24 16:39:19 $ + Version: $Revision: 1.37 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -76,6 +76,7 @@ void ValEntry::Print(std::ostream & os) TSKey v; std::string d2; + os << "V "; DocEntry::Print(os); if (g == 0xfffe) @@ -108,7 +109,7 @@ void ValEntry::Print(std::ostream & os) { if ( v.length() != 0 ) // for brain damaged headers { - if ( ! isdigit(v[v.length()-1]) ) + if ( ! isdigit((unsigned char)v[v.length()-1]) ) { v.erase(v.length()-1, 1); } @@ -124,7 +125,7 @@ void ValEntry::Print(std::ostream & os) { if ( v.length() != 0 ) // for brain damaged headers { - if ( ! isdigit(v[v.length()-1]) ) + if ( ! isdigit((unsigned char)v[v.length()-1]) ) { v.erase(v.length()-1, 1); } @@ -140,7 +141,7 @@ void ValEntry::Print(std::ostream & os) { if ( v.length() != 0 ) // for brain damaged headers { - if ( ! isdigit(v[v.length()-1]) ) + if ( ! isdigit((unsigned char)v[v.length()-1]) ) { v.erase(v.length()-1, 1); } @@ -188,7 +189,7 @@ void ValEntry::Write(std::ofstream* fp, FileType filetype) } std::string vr = GetVR(); - int lgr = GetReadLength(); + unsigned int lgr = GetReadLength(); if (vr == "US" || vr == "SS") { // some 'Short integer' fields may be mulivaluated @@ -222,10 +223,9 @@ void ValEntry::Write(std::ofstream* fp, FileType filetype) tokens.clear(); return; } - - fp->write (GetValue().c_str(), (size_t)lgr ); // Elem value -// assert( lgr == GetValue().size() ); // FIXME ????? -// dbg.Assert(2, lgr == strlen(GetValue().c_str()), "Should be equal" ); + + assert( lgr == GetValue().size() ); + binary_write(*fp, GetValue()); } //-----------------------------------------------------------------------------