X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDocument.cxx;h=1a3f177c3525696ae6a6126d146b0625c3f84943;hb=4f3b36b1db085e9be749d2cababa274d1e76b68d;hp=0d6396c93f7926917038e9655672a720cf378a04;hpb=da0bfa12abf63a06edc9d06d88ea0d3164fec1db;p=gdcm.git diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 0d6396c9..1a3f177c 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/11/05 13:23:30 $ - Version: $Revision: 1.325 $ + Date: $Date: 2005/11/21 16:28:06 $ + Version: $Revision: 1.331 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -89,18 +89,17 @@ bool Document::Load( ) return false; } return DoTheLoadingDocumentJob( ); -} -/** - * \brief Loader. (DEPRECATED : not to break the API) - * @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. - */ +} + +/* +//#ifndef GDCM_LEGACY_REMOVE bool Document::Load( std::string const &fileName ) { Filename = fileName; return DoTheLoadingDocumentJob( ); } +//#endif +*/ /** * \brief Performs the Loading Job (internal use only) @@ -337,22 +336,33 @@ bool Document::SetShaDict(DictKey const &dictName) * @return false when we're 150 % sure it's NOT a Dicom/Acr file, * true otherwise. */ -bool Document::IsReadable() +bool Document::IsParsable() { if ( Filetype == Unknown ) { - gdcmErrorMacro( "Wrong filetype for " << GetFileName()); + gdcmWarningMacro( "Wrong filetype for " << GetFileName()); return false; } if ( IsEmpty() ) { - gdcmErrorMacro( "No tag in internal hash table."); + gdcmWarningMacro( "No tag in internal hash table."); return false; } return true; } +/** + * \brief This predicate tells us whether or not the current Document + * was properly parsed and contains at least *one* Dicom Element + * (and nothing more, sorry). + * @return false when we're 150 % sure it's NOT a Dicom/Acr file, + * true otherwise. + */ +bool Document::IsReadable() +{ + return IsParsable(); +} /** * \brief Predicate for dicom version 3 file. @@ -708,15 +718,15 @@ void Document::LoadEntryBinArea(uint16_t group, uint16_t elem) DocEntry *docEntry = GetDocEntry(group, elem); if ( !docEntry ) { - gdcmWarningMacro(std::hex << group << "|" << elem - << "doesn't exist" ); + gdcmDebugMacro(std::hex << group << "|" << elem + << " doesn't exist" ); return; } DataEntry *dataEntry = dynamic_cast(docEntry); if ( !dataEntry ) { gdcmWarningMacro(std::hex << group << "|" << elem - << "is NOT a DataEntry"); + << " is NOT a DataEntry"); return; } LoadEntryBinArea(dataEntry); @@ -931,7 +941,6 @@ uint32_t Document::ReadInt32() /** * \brief skips bytes inside the source file - * \warning NOT end user intended method ! * @return */ void Document::SkipBytes(uint32_t nBytes) @@ -988,7 +997,6 @@ int Document::ComputeGroup0002Length( ) // Private /** * \brief Loads all the needed Dictionaries - * \warning NOT end user intended method ! */ void Document::Initialize() { @@ -1465,7 +1473,6 @@ void Document::FindDocEntryLength( DocEntry *entry ) /** * \brief Find the Length till the next sequence delimiter - * \warning NOT end user intended method ! * @return */ uint32_t Document::FindDocEntryLengthOBOrOW() @@ -1572,7 +1579,6 @@ bool Document::CheckDocEntryVR(const VRKey &vr) /** * \brief Skip a given Header Entry - * \warning NOT end user intended method ! * @param entry entry to skip */ void Document::SkipDocEntry(DocEntry *entry) @@ -1582,7 +1588,6 @@ void Document::SkipDocEntry(DocEntry *entry) /** * \brief Skips to the beginning of the next Header Entry - * \warning NOT end user intended method ! * @param currentDocEntry entry to skip */ void Document::SkipToNextDocEntry(DocEntry *currentDocEntry)