]> Creatis software - gdcm.git/blobdiff - src/gdcmDocEntry.cxx
STYLE: No DOS file, please
[gdcm.git] / src / gdcmDocEntry.cxx
index e2a89b1def4d7184b45fda908a4f45795b6c1198..ed0a9e8b7f7e5631b28b2a505bc8b0045ccd7c84 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/08/31 14:24:47 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2004/09/17 08:54:26 $
+  Version:   $Revision: 1.20 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -36,7 +36,9 @@
 gdcmDocEntry::gdcmDocEntry(gdcmDictEntry* in)
 {
    ImplicitVR = false;
-   DictEntry = in;
+   DictEntry  = in;
+   SetKey( in->GetKey( ) );
+   Offset     = 0 ; // To avoid further missprinting
 }
 
 //-----------------------------------------------------------------------------
@@ -57,18 +59,17 @@ void gdcmDocEntry::Print(std::ostream & os)
    std::string d2, vr;
    std::ostringstream s;
    uint32_t lgth;
-   char greltag[10];  //group element tag
 
    g  = GetGroup();
    e  = GetElement();
    o  = GetOffset();
    vr = GetVR();
-   sprintf(greltag,"%04x|%04x ",g,e);           
-   s << greltag ;
+
+   s << GetKey();
        
    if (PrintLevel >= 2)
    {
-      s << "lg : ";
+      s << " lg : ";
       lgth = GetReadLength(); // ReadLength, as opposed to UsableLength
       if (lgth == 0xffffffff)
       {
@@ -163,7 +164,7 @@ void gdcmDocEntry::Write(FILE *fp, FileType filetype)
          // Unknown was 'written'
          // deal with Little Endian            
          fwrite ( &shortLgr,(size_t)2 ,(size_t)1 ,fp);
-         fwrite ( &z,  (size_t)2 ,(size_t)1 ,fp);
+         fwrite ( &z,       (size_t)2 ,(size_t)1 ,fp);
       }
       else
       {