00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef MDIRSCANNER_H
00019 #define MDIRSCANNER_H
00020 
00021 #include <string>
00022 #include <vector>
00023 
00027 class MDirScanner {
00028 public: 
00029    
00030    struct MEntry {
00031       
00032       std::string Path, Name;
00033       int         Type;
00034       
00035       };
00036 
00037    
00038    struct MOptions {
00039       MOptions() : Relative(true), IncludeDots(false), IncludeHidden(false),
00040          Depth(0), IncludeFiles(true), IncludeDirs(true), Sep("/") {}
00047       bool Relative, IncludeDots, IncludeHidden;
00048       bool IncludeFiles, IncludeDirs;
00049       int Depth;
00050       std::string Sep;
00051       } Options;
00052             
00053    typedef std::vector<MEntry> MList;
00054    typedef MList::iterator MListIte;
00055 
00056    MList List;
00057 
00058    MDirScanner();
00059    ~MDirScanner();
00060 
00061    void Scan(const std::string& dir);
00062    
00063 private:
00064    void Scan(const std::string& dir, const std::string& base, int depth);
00065 
00066 };
00067 
00068 #endif