]> Creatis software - gdcm.git/blobdiff - src/gdcmDocument.cxx
Remove useless PrintHeader (replaced by PrintDocument)
[gdcm.git] / src / gdcmDocument.cxx
index 0147abbe90c9d4b0434b6cfa21f4f9350043bbba..aa4f965d2220ac669b08746698d81c48b15f05ac 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/03/22 11:29:37 $
-  Version:   $Revision: 1.233 $
+  Date:      $Date: 2005/04/24 20:54:45 $
+  Version:   $Revision: 1.236 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -47,8 +47,7 @@ const unsigned int Document::MAX_SIZE_LOAD_ELEMENT_VALUE = 0xfff; // 4096
 
 /**
  * \brief This default constructor neither loads nor parses the file. 
- *        You should then invoke \ref Document::SetFileName 
- *        and \ref Document::Load.
+ *        You should then invoke \ref Document::Load.
  *         
  */
 Document::Document() 
@@ -61,7 +60,7 @@ Document::Document()
    SwapCode = 1234;
    Filetype = ExplicitVR;
    Group0002Parsed = false;
-   LoadMode = 0x00000000; // Load everything
+   LoadMode = 0x00000000; // default : load everything, later
 }
 
 /**
@@ -428,10 +427,9 @@ std::ifstream *Document::OpenFile()
    Fp = new std::ifstream(Filename.c_str(), std::ios::in | std::ios::binary);
    if( ! *Fp )
    {
-      gdcmDebugMacro( "Cannot open file: " << Filename.c_str());
+      gdcmErrorMacro( "Cannot open file: " << Filename.c_str());
       delete Fp;
-      Fp = 0;
-      return 0;
+      exit(1);
    }
  
    uint16_t zero = 0;
@@ -943,7 +941,7 @@ void Document::ParseDES(DocEntrySet *set, long offset,
               delim_mode = false;
             }
          }
-
          if ( (LoadMode & NO_SEQ) && ! delim_mode ) // User asked to skip SQ
          {
             Fp->seekg( l, std::ios::cur);
@@ -1109,8 +1107,10 @@ void Document::LoadDocEntry(DocEntry *entry)
       {  
          //s << "gdcm::NotLoaded (BinEntry)";
          s << GDCM_NOTLOADED;
-         s << " Address:" << (long)entry->GetOffset();
-         s << " Length:"  << entry->GetLength();
+         s << " Ad.:" << (long)entry->GetOffset();
+         s << " x(" << std::hex << entry->GetOffset() << ")";
+         s << std::dec;
+         s << " Lgt:"  << entry->GetLength();
          s << " x(" << std::hex << entry->GetLength() << ")";
          binEntryPtr->SetValue(s.str());
       }