From db42dcafe4dafd893c12b6d209870d66ec474a1b Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 20 Jul 2005 14:49:41 +0000 Subject: [PATCH] Use GDCM_LEGACY for DicomDir, as well --- src/gdcmDebug.h | 10 +++++++--- src/gdcmDicomDir.cxx | 22 ++++++++++++++++++---- src/gdcmDicomDir.h | 18 +++++++++--------- src/gdcmFile.cxx | 13 +++++++------ 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/src/gdcmDebug.h b/src/gdcmDebug.h index 85eda8b3..c597d65e 100644 --- a/src/gdcmDebug.h +++ b/src/gdcmDebug.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDebug.h,v $ Language: C++ - Date: $Date: 2005/07/19 14:43:48 $ - Version: $Revision: 1.36 $ + Date: $Date: 2005/07/20 14:49:42 $ + Version: $Revision: 1.37 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -193,7 +193,11 @@ public: //----------------------------------------------------------------------------- // // Define GDCM_LEGACY macro to mark legacy methods where they are -// declared in their class. Example usage: +// declared in their class. +// +// WARNING : Don't try to use it with 'inline' methods ! +// +//Example usage: // // // @deprecated Replaced by MyOtherMethod() as of gdcm 2.0. // GDCM_LEGACY(void MyMethod()); diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index de95ee68..12eb2746 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/07/19 15:19:26 $ - Version: $Revision: 1.149 $ + Date: $Date: 2005/07/20 14:49:41 $ + Version: $Revision: 1.150 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -134,7 +134,10 @@ DicomDir::DicomDir() * and wants to explore recursively the directories * - false if user passed an already built DICOMDIR file * and wants to use it + * @deprecated use : new DicomDir() + [ SetLoadMode(lm) + ] SetDirectoryName(name) + * or : new DicomDir() + SetFileName(name) */ +#ifndef GDCM_LEGACY_REMOVE DicomDir::DicomDir(std::string const &fileName, bool parseDir ): Document( ) { @@ -147,6 +150,7 @@ DicomDir::DicomDir(std::string const &fileName, bool parseDir ): SetLoadMode (0x00000000); // concerns only dicom files Load( fileName ); } +#endif /** * \brief Canonical destructor @@ -168,7 +172,8 @@ DicomDir::~DicomDir() // Public /** - * \brief Loader. use SetLoadMode(), SetFileName() before ! + * \brief Loader. use SetFileName(fn) + * or SetLoadMode(lm) + SetDirectoryName(dn) before ! * @return false if file cannot be open or no swap info was found, * or no tag was found. */ @@ -185,11 +190,13 @@ bool DicomDir::Load( ) return DoTheLoadingJob( ); } + #ifndef GDCM_LEGACY_REMOVE /** - * \brief Loader. (DEPRECATED : not to break the API) + * \brief Loader. (DEPRECATED : kept 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. + * @deprecated use SetFileName(n) + Load() instead */ bool DicomDir::Load(std::string const &fileName ) { @@ -205,6 +212,13 @@ bool DicomDir::Load(std::string const &fileName ) return DoTheLoadingJob( ); } +/// DEPRECATED : use SetDirectoryName(dn) instead +void DicomDir::SetParseDir(bool parseDir) +{ + ParseDir = parseDir; +} +#endif + /** * \brief Does the Loading Job (internal use only) * @return false if file cannot be open or no swap info was found, diff --git a/src/gdcmDicomDir.h b/src/gdcmDicomDir.h index 09d0f5e9..b47c3d30 100644 --- a/src/gdcmDicomDir.h +++ b/src/gdcmDicomDir.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.h,v $ Language: C++ - Date: $Date: 2005/07/17 04:28:55 $ - Version: $Revision: 1.64 $ + Date: $Date: 2005/07/20 14:49:42 $ + Version: $Revision: 1.65 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -20,6 +20,7 @@ #define GDCMDICOMDIR_H #include "gdcmDocument.h" +#include "gdcmDebug.h" #include #include @@ -36,8 +37,8 @@ class DicomDirVisit; class DicomDirImage; class SQItem; -typedef std::list ListDicomDirPatient; -typedef std::vector VectDocument; +typedef std::list ListDicomDirPatient; +typedef std::vector VectDocument; //----------------------------------------------------------------------------- /** @@ -52,12 +53,11 @@ class GDCM_EXPORT DicomDir: public Document public: typedef void Method(void*); - DicomDir( std::string const &filename, bool parseDir = false ); // Deprecated DicomDir(); - + GDCM_LEGACY( DicomDir(std::string const &filename, bool parseDir = false) ); ~DicomDir(); - bool Load( std::string const &filename ); + GDCM_LEGACY( bool Load(std::string const &filename) ); bool Load( ); void Print(std::ostream &os = std::cout, std::string const &indent = "" ); @@ -68,10 +68,10 @@ public: /// Accessor to \ref Filename virtual void SetFileName(std::string const &fileName) { ParseDir = false; if (Filename != fileName) - Filename = fileName, IsDocumentModified = true; } + Filename = fileName, IsDocumentModified = true;}; /// DEPRECATED : use SetDirectoryName - void SetParseDir(bool parseDir) { ParseDir = parseDir; }; + GDCM_LEGACY( void SetParseDir(bool parseDir) ); // Informations contained in the parser virtual bool IsReadable(); diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index b85f3b6c..13570e21 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/07/20 13:31:01 $ - Version: $Revision: 1.253 $ + Date: $Date: 2005/07/20 14:49:41 $ + Version: $Revision: 1.254 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -1732,11 +1732,12 @@ void File::ReadAndSkipEncapsulatedBasicOffsetTable() } // These are the deprecated method that one day should be removed (after the next release) + #ifndef GDCM_LEGACY_REMOVE /** - * \brief Constructor + * \brief Constructor (DEPRECATED : temporaryly kept not to break the API) * @param filename name of the file whose header we want to analyze - * @deprecated do not use anymore + * @deprecated do not use any longer */ File::File( std::string const &filename ) :Document( ) @@ -1748,11 +1749,11 @@ File::File( std::string const &filename ) } /** - * \brief Loader. (DEPRECATED : not to break the API) + * \brief Loader. (DEPRECATED : temporaryly kept 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. - * @deprecated Use the Load() function instead + * @deprecated Use the Load() [ + SetLoadMode() ] + SetFileName() functions instead */ bool File::Load( std::string const &fileName ) { -- 2.48.1