]> Creatis software - crea.git/blob - src/creaFilesFromDirectory.h
*** empty log message ***
[crea.git] / src / creaFilesFromDirectory.h
1 #ifndef _crea_DIRLIST_H_
2 #define _crea_DIRLIST_H_
3    
4
5
6 #include <string>
7 #include <vector>
8 #include <iostream>
9
10 namespace crea
11 {
12 class  DirList
13 {
14 public :
15    DirList(std::string const &dirName, bool recursive);
16    ~DirList();
17
18
19    std::string NormalizePath(std::string const &pathname); 
20
21    /// Return the name of the directory
22    std::string const &GetDirName() const { return DirName; }
23
24    /// Return the file names
25    std::vector<std::string> const &GetFilenames() const { return Filenames; }
26
27     /// Return the number of Files
28    int GetSize() const { return Filenames.size(); }  
29
30    static bool IsDirectory(std::string const &dirName);
31
32    std::string GetFirst();
33    std::string GetNext();
34
35 private :
36    int Explore(std::string const &dirName, bool recursive=false);
37
38    /// List of file names
39    std::vector<std::string> Filenames;
40    /// name of the root directory to explore
41    std::string DirName;
42
43 };
44
45 }
46
47 #endif