X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmFile.cxx;h=214d8035162bb3cdb4828970230063a55e1cf02e;hb=fbd2698cb0545343abc2d8aefe92bab1f5b3eaa3;hp=0205469d3d9f856090762faaedc6be184109fdf4;hpb=986a43287516de55e51b476572366c85e9fa2b8d;p=gdcm.git diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 0205469d..214d8035 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2005/06/30 14:49:02 $ - Version: $Revision: 1.245 $ + Date: $Date: 2005/07/07 16:37:40 $ + Version: $Revision: 1.249 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -39,8 +39,9 @@ #include "gdcmRLEFramesInfo.h" #include "gdcmJPEGFragmentsInfo.h" -#include //sscanf #include +#include //sscanf +#include // for atoi namespace gdcm { @@ -64,12 +65,12 @@ File::File(): * @param filename name of the file whose header we want to analyze */ File::File( std::string const &filename ) - :Document(filename) + :Document( ) { RLEInfo = new RLEFramesInfo; JPEGInfo = new JPEGFragmentsInfo; - Load( filename ); + Load( filename ); // gdcm::Document is first Loaded, then the 'File part' } /** @@ -85,16 +86,40 @@ File::~File () //----------------------------------------------------------------------------- // Public - /** * \brief Loader + * @return false if file cannot be open or no swap info was found, + * or no tag was found. + */ +bool File::Load( ) +{ + if ( ! this->Document::Load( ) ) + return false; + + return DoTheLoadingJob( ); +} +/** + * \brief Loader. (DEPRECATED : not to break the API) * @param fileName file to be open for parsing * @return false if file cannot be open or no swap info was found, * or no tag was found. */ bool File::Load( std::string const &fileName ) { - this->Document::Load( fileName ); + SetFileName( fileName ); + if ( ! this->Document::Load( ) ) + return false; + + return DoTheLoadingJob( ); +} + +/** + * \brief Does the Loading Job (internal use only) + * @return false if file cannot be open or no swap info was found, + * or no tag was found. + */ +bool File::DoTheLoadingJob( ) +{ // for some ACR-NEMA images GrPixel, NumPixel is *not* 7fe0,0010 // We may encounter the 'RETired' (0x0028, 0x0200) tag