1 /*=========================================================================
4 Module: $RCSfile: gdcmDirList.h,v $
6 Date: $Date: 2006/11/15 15:53:08 $
7 Version: $Revision: 1.32 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
31 typedef std::vector<std::string> DirListType;
33 //-----------------------------------------------------------------------------
35 // NOTE: Due to a M$VC6 'feature' we cannot export a std::list in a dll,
36 // so GDCM_EXPORT keyword was removed for this class only
39 * \brief List containing the file headers of all the 'gdcm readable' files
40 * found by exploring (possibly recursively) a root directory.
42 class GDCM_EXPORT DirList : public Base
45 DirList(std::string const &dirName, bool recursive);
48 void Print(std::ostream &os = std::cout, std::string const &indent = "" );
50 /// Return the name of the directory
51 std::string const &GetDirName() const { return DirName; }
53 /// Return the file names
54 DirListType const &GetFilenames() const { return Filenames; }
56 /// Return the number of Files
57 int GetSize() const { return Filenames.size(); }
59 static bool IsDirectory(std::string const &dirName);
61 std::string GetFirst();
62 std::string GetNext();
65 int Explore(std::string const &dirName, bool recursive=false);
67 /// List of file names
68 DirListType Filenames;
69 /// name of the root directory to explore
72 /// iterator on the SQItems of the current SeqEntry
73 DirListType::iterator ItDirList;
76 } // end namespace gdcm
77 //-----------------------------------------------------------------------------