OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimFileWalker.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // File: ossimFileWalker.h
4 //
5 // License: MIT
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 // Author: David Burken
10 //
11 // Description: See description for class below.
12 //
13 //----------------------------------------------------------------------------
14 // $Id$
15 
16 #ifndef ossimFileWalker_HEADER
17 #define ossimFileWalker_HEADER 1
18 
23 #include <string>
24 #include <vector>
25 #include <mutex>
26 #include <memory>
27 
28 class ossimFilename;
30 
47 {
48 public:
49 
52 
54  ~ossimFileWalker();
55 
71  void walk(const std::vector<ossimFilename>& files);
72 
84  void walk(const ossimFilename& root);
85 
91  void setFileProcessor(ossimFileProcessorInterface* fpi);
92 
94  const std::vector<std::string>& getFilteredExtensions() const;
95 
103  std::vector<std::string>& getFilteredExtensions();
104 
106  void dumpFilteredExtensionList() const;
107 
112  void initializeDefaultFilterList();
113 
125  void setRecurseFlag(bool flag);
126 
137  void setWaitOnDirFlag(bool flag);
138 
143  void setAbortFlag(bool flag);
144 
146  void setNumberOfThreads(ossim_uint32 nThreads);
147 
148 private:
149 
152  {
153  public:
160  const ossimFilename& file);
161 
162 protected:
168  virtual void run();
169 
170  private:
173 
174  }; // End: class ossimFileWalkerJob
175 
178  {
179  public:
181  virtual void started(std::shared_ptr<ossimJob> job);
182  virtual void finished(std::shared_ptr<ossimJob> job);
183  virtual void canceled(std::shared_ptr<ossimJob> job);
184  };
185 
192  void walkDir(const ossimFilename& dir);
193 
202  bool isFiltered(const ossimFilename& f) const;
203 
209  bool isDotFile(const ossimFilename& f) const;
210 
217  std::shared_ptr<ossimJobMultiThreadQueue> m_jobQueue;
218  std::vector<std::string> m_filteredExtensions;
222  std::mutex m_mutex;
223 };
224 
225 #endif /* #ifndef ossimFileWalker_HEADER */
Private ossimJobCallback class.
ossimFileProcessorInterface * m_fileProcessor
ossimFileProcessorInterface * m_fileProcessor
Callback to method to process a file.
Utility class to walk through directories and get a list of files to process.
std::shared_ptr< ossimJobMultiThreadQueue > m_jobQueue
std::mutex m_mutex
unsigned int ossim_uint32
#define OSSIM_DLL
This is the job callback interface It allows one to attach and listen for different states of the job...
Definition: ossimJob.h:149
std::vector< std::string > m_filteredExtensions
This is the job callback interface It allows one to attach and listen for different states of the job...
Definition: ossimJob.h:68