Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
hugin1/ptbatcher/DirTraverser.h
Go to the documentation of this file.00001 // -*- c-basic-offset: 4 -*- 00002 00027 #include <wx/dir.h> 00028 #include <wx/filename.h> 00029 //#include <wx/msgdlg.h> 00030 00031 class DirTraverser : public wxDirTraverser 00032 { 00033 public: 00034 DirTraverser():wxDirTraverser(){ } 00035 00036 //Called when directory traverser evaluates a file 00037 virtual wxDirTraverseResult OnFile(const wxString& file) 00038 { 00039 wxFileName fileName(file); 00040 wxString ext = fileName.GetExt(); 00041 //we add all project files to array 00042 if (ext.CmpNoCase(wxT("pto")) == 0 || ext.CmpNoCase(wxT("ptp")) == 0|| 00043 ext.CmpNoCase(wxT("pts")) == 0|| ext.CmpNoCase(wxT("oto")) == 0) 00044 projectFiles.Add(file); 00045 00046 //TO-DO: include image file heuristics to detect potential projects 00047 return wxDIR_CONTINUE; 00048 } 00049 00050 //Called when directory traverser evaluates a directory 00051 virtual wxDirTraverseResult OnDir(const wxString& WXUNUSED(dir)) 00052 { 00053 return wxDIR_CONTINUE; 00054 } 00055 00056 //Returns an array with all project files found 00057 wxArrayString GetProjectFiles() 00058 { 00059 return projectFiles; 00060 } 00061 private: 00062 wxArrayString projectFiles; 00063 };
1.3.9.1