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 
00030 class DirTraverser : public wxDirTraverser
00031 {
00032 public:
00033     DirTraverser():wxDirTraverser() { }
00034 
00035     //Called when directory traverser evaluates a file
00036     virtual wxDirTraverseResult OnFile(const wxString& file)
00037     {
00038         wxFileName fileName(file);
00039         wxString ext = fileName.GetExt();
00040         //we add all project files to array
00041         if (ext.CmpNoCase(wxT("pto")) == 0 || ext.CmpNoCase(wxT("ptp")) == 0||
00042                 ext.CmpNoCase(wxT("pts")) == 0|| ext.CmpNoCase(wxT("oto")) == 0)
00043         {
00044             projectFiles.Add(file);
00045         }
00046 
00047         //TO-DO: include image file heuristics to detect potential projects
00048         return wxDIR_CONTINUE;
00049     }
00050 
00051     //Called when directory traverser evaluates a directory
00052     virtual wxDirTraverseResult OnDir(const wxString& WXUNUSED(dir))
00053     {
00054         return wxDIR_CONTINUE;
00055     }
00056 
00057     //Returns an array with all project files found
00058     wxArrayString GetProjectFiles()
00059     {
00060         return projectFiles;
00061     }
00062 private:
00063     wxArrayString projectFiles;
00064 };

Generated on 27 Nov 2014 for Hugintrunk by  doxygen 1.4.7