X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDocument.cxx;h=17a7cdfee552a9fcaab071edc4a9cad1b1285169;hb=33ea8275362b9654ecd921e55367af7008e28fdc;hp=cc3679cada0add88b233420c5bf0552245eb0c9c;hpb=10f41c98cf3de1fa1c053ab6055ac1b3bb56351a;p=gdcm.git diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index cc3679ca..17a7cdfe 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/06/03 16:05:23 $ - Version: $Revision: 1.243 $ + Date: $Date: 2005/06/10 14:05:38 $ + Version: $Revision: 1.245 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -35,8 +35,6 @@ namespace gdcm { //----------------------------------------------------------------------------- -// Refer to Document::CheckSwap() -//const unsigned int Document::HEADER_LENGTH_TO_READ = 256; // Refer to Document::SetMaxSizeLoadEntry() const unsigned int Document::MAX_SIZE_LOAD_ELEMENT_VALUE = 0xfff; // 4096 @@ -67,7 +65,7 @@ Document::Document() /** * \brief Constructor (not to break the API) - * @param fileName 'Document' (File or DicomDir) to be opened for parsing + * @param fileName 'Document' (File or DicomDir) to be open for parsing */ Document::Document( std::string const &fileName ) :ElementSet(-1) @@ -85,11 +83,6 @@ Document::Document( std::string const &fileName ) IsDocumentAlreadyLoaded = false; Load(fileName); - - // Normaly (?) Fp should be already deleted by CloseFile() - if ( Fp != 0 ) - delete Fp; - Fp = 0; } /** * \brief Canonical destructor. @@ -105,7 +98,7 @@ Document::~Document () /** * \brief Loader - * @param fileName 'Document' (File or DicomDir) to be opened for parsing + * @param fileName 'Document' (File or DicomDir) to be open for parsing * @return false if file cannot be open or no swap info was found, * or no tag was found. */ @@ -120,7 +113,7 @@ bool Document::Load( std::string const &fileName ) << Filename.c_str() << ". New name is :" << fileName ); // todo : clean out the 'Document' - // We should call ClearEntry() on the parent object ?!? + // Should we call ClearEntry() on the parent object ?!? } Filename = fileName; @@ -947,7 +940,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, if ( strLgrGroup != GDCM_UNFOUND) { lgrGroup = atoi(strLgrGroup.c_str()); - Fp->seekg(lgrGroup , std::ios::cur); + Fp->seekg(lgrGroup, std::ios::cur); used = false; continue; } @@ -1158,7 +1151,6 @@ void Document::LoadDocEntry(DocEntry *entry) { if (BinEntry *binEntryPtr = dynamic_cast< BinEntry* >(entry) ) { - //s << "gdcm::NotLoaded (BinEntry)"; s << GDCM_NOTLOADED; s << " Ad.:" << (long)entry->GetOffset(); s << " x(" << std::hex << entry->GetOffset() << ")"; @@ -1167,10 +1159,8 @@ void Document::LoadDocEntry(DocEntry *entry) s << " x(" << std::hex << entry->GetLength() << ")"; binEntryPtr->SetValue(s.str()); } - // Be carefull : a BinEntry IS_A ValEntry ... else if (ValEntry *valEntryPtr = dynamic_cast< ValEntry* >(entry) ) { - // s << "gdcm::NotLoaded. (ValEntry)"; s << GDCM_NOTLOADED; s << " Address:" << (long)entry->GetOffset(); s << " Length:" << entry->GetLength(); @@ -1204,7 +1194,7 @@ void Document::LoadDocEntry(DocEntry *entry) uint32_t NewInt; int nbInt; // When short integer(s) are expected, read and convert the following - // n *two characters properly i.e. consider them as short integers as + // (n * 2) characters properly i.e. consider them as short integers as // opposed to strings. // Elements with Value Multiplicity > 1 // contain a set of integers (not a single one) @@ -1257,7 +1247,7 @@ void Document::LoadDocEntry(DocEntry *entry) { newValue = Util::DicomString(str, length+1); gdcmWarningMacro("Warning: bad length: " << length << - ",For string :" << newValue.c_str()); + " ,For string :" << newValue.c_str()); // Since we change the length of string update it length //entry->SetReadLength(length+1); }