Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DirTraverser.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
27 #include <wx/dir.h>
28 #include <wx/filename.h>
29 
30 class DirTraverser : public wxDirTraverser
31 {
32 public:
33  DirTraverser():wxDirTraverser() { }
34 
35  //Called when directory traverser evaluates a file
36  virtual wxDirTraverseResult OnFile(const wxString& file)
37  {
38  wxFileName fileName(file);
39  wxString ext = fileName.GetExt();
40  //we add all project files to array
41  if (ext.CmpNoCase(wxT("pto")) == 0 || ext.CmpNoCase(wxT("ptp")) == 0||
42  ext.CmpNoCase(wxT("pts")) == 0|| ext.CmpNoCase(wxT("oto")) == 0)
43  {
44  projectFiles.Add(file);
45  }
46 
47  //TO-DO: include image file heuristics to detect potential projects
48  return wxDIR_CONTINUE;
49  }
50 
51  //Called when directory traverser evaluates a directory
52  virtual wxDirTraverseResult OnDir(const wxString& WXUNUSED(dir))
53  {
54  return wxDIR_CONTINUE;
55  }
56 
57  //Returns an array with all project files found
58  wxArrayString GetProjectFiles()
59  {
60  return projectFiles;
61  }
62 private:
63  wxArrayString projectFiles;
64 };
virtual wxDirTraverseResult OnDir(const wxString &WXUNUSED(dir))
Definition: DirTraverser.h:52
wxArrayString GetProjectFiles()
Definition: DirTraverser.h:58
virtual wxDirTraverseResult OnFile(const wxString &file)
Definition: DirTraverser.h:36
wxArrayString projectFiles
Definition: DirTraverser.h:63