10 #ifndef WS_DIRECTORY_CRAWLER_H__
11 #define WS_DIRECTORY_CRAWLER_H__
13 #define BOOST_FILESYSTEM_NO_DEPRECATED
15 #include <boost/filesystem.hpp>
51 int browse(
const boost::filesystem::path& p);
63 virtual int applyFile(
const boost::filesystem::path& p) = 0;
73 virtual void beginChild(
const boost::filesystem::path& p) = 0;
78 virtual void endChild(
const boost::filesystem::path& p) = 0;
Abstract class used to crawl a directory.
int browse(const boost::filesystem::path &p)
applies the required action if file or folder, and browse its children
int start()
Start crawling over all the files and directories/subdirectories.
WsDirectoryCrawler(const std::string &path)
Class constructor, this class is Abstract and must therefore be inherited.
virtual void endChild(const boost::filesystem::path &p)=0
this method is called when finished browsing the subdir
virtual int applyFile(const boost::filesystem::path &p)=0
this method is called by browse when the boost::filesystem::path is a file
virtual void beginChild(const boost::filesystem::path &p)=0
this method is called before browsing a subdirectory
virtual int applyDirectory(const boost::filesystem::path &p)=0
this method is called by browse when the boost::filesystem::path is a folder
virtual ~WsDirectoryCrawler()=0
Virtual destructor.