X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDirList.h;h=b30bc953db5b1dab82f1332fad02219be69497ae;hb=8401b1407f4b482a8d9e8cf6759009d1076b6a7c;hp=8361a808811906c55f64ad6075228e88d06b64f3;hpb=aa74099d3b9e6bf860806305891414f048b7e9a0;p=gdcm.git diff --git a/src/gdcmDirList.h b/src/gdcmDirList.h index 8361a808..b30bc953 100644 --- a/src/gdcmDirList.h +++ b/src/gdcmDirList.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDirList.h,v $ Language: C++ - Date: $Date: 2005/01/14 21:52:06 $ - Version: $Revision: 1.17 $ + Date: $Date: 2005/11/21 09:46:26 $ + Version: $Revision: 1.27 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,35 +28,38 @@ namespace gdcm { +typedef std::vector DirListType; + //----------------------------------------------------------------------------- -/** - * \ingroup DirList - * \brief List containing the file Header s of all the gdcm readable files - * found by exploring recursively a root directory. - */ -// NOTE: Due to a VC6 'feature' we can not export a std::list in a dll, + +// NOTE: Due to a M$VC6 'feature' we cannot export a std::list in a dll, // so GDCM_EXPORT keyword was removed for this class only -class DirList : public std::vector +/** + * \brief List containing the file headers of all the 'gdcm readable' files + * found by exploring (possibely recursively) a root directory. + */ +class GDCM_EXPORT DirList { public : DirList(std::string const &dirName, bool recursive=false); - virtual ~DirList(); - - std::string const &GetDirName() const; + ~DirList(); void Print(std::ostream &os = std::cout); - /// Character '\' - static const char SEPARATOR_X; - /// Character '/' - static const char SEPARATOR_WIN; - /// depending on the O.S. - static const std::string SEPARATOR; + /// Return the name of the directory + std::string const &GetDirName() const { return DirName; } + + /// Return the file names + DirListType const &GetFilenames() const { return Filenames; } + + static bool IsDirectory(std::string const &dirName); private : int Explore(std::string const &dirName, bool recursive=false); + /// List of file names + DirListType Filenames; /// name of the root directory to explore std::string DirName; };