]> Creatis software - gdcm.git/blob - src/gdcmDirList.h
BUG: Could not use DirList from a dll on windows since the symbol was not exported...
[gdcm.git] / src / gdcmDirList.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDirList.h,v $
5   Language:  C++
6   Date:      $Date: 2005/01/14 22:20:11 $
7   Version:   $Revision: 1.18 $
8                                                                                 
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMDIRLIST_H
20 #define GDCMDIRLIST_H
21
22 #include "gdcmCommon.h"
23
24 #include <string>
25 #include <vector>
26 #include <iostream>
27
28 namespace gdcm 
29 {
30
31 //-----------------------------------------------------------------------------
32 /**
33  * \ingroup DirList
34  * \brief   List containing the file Header s of all the gdcm readable files
35  *          found by exploring recursively a root directory. 
36  */
37 // NOTE: Due to a VC6 'feature' we can not export a std::list in a dll, 
38 // so GDCM_EXPORT keyword was removed for this class only
39
40 typedef std::vector<std::string> DirListType;
41
42 class GDCM_EXPORT DirList
43 {
44 public :
45    DirList(std::string const &dirName, bool recursive=false);
46    ~DirList();
47
48    /// Return the name of the directory
49    std::string const &GetDirName() const { return DirName; }
50
51    /// Return the file names
52    DirListType const &GetFilenames() const { return Filenames; };
53
54    /// Print all element of the DirList
55    void Print(std::ostream &os = std::cout);
56
57 private :
58    int Explore(std::string const &dirName, bool recursive=false);
59
60    DirListType Filenames;
61
62    /// name of the root directory to explore
63    std::string DirName;
64 };
65 } // end namespace gdcm
66 //-----------------------------------------------------------------------------
67 #endif