Wittyshare
0.2
|
Abstract class used to crawl a directory. More...
#include <WsDirectoryCrawler.h>
Public Member Functions | |
WsDirectoryCrawler (const std::string &path) | |
Class constructor, this class is Abstract and must therefore be inherited. More... | |
virtual | ~WsDirectoryCrawler ()=0 |
Virtual destructor. More... | |
int | start () |
Start crawling over all the files and directories/subdirectories. More... | |
Protected Member Functions | |
virtual int | applyFile (const boost::filesystem::path &p)=0 |
this method is called by browse when the boost::filesystem::path is a file More... | |
virtual int | applyDirectory (const boost::filesystem::path &p)=0 |
this method is called by browse when the boost::filesystem::path is a folder More... | |
virtual void | beginChild (const boost::filesystem::path &p)=0 |
this method is called before browsing a subdirectory More... | |
virtual void | endChild (const boost::filesystem::path &p)=0 |
this method is called when finished browsing the subdir More... | |
Protected Attributes | |
std::string | m_p |
bool | m_isLoaded |
Private Member Functions | |
int | browse (const boost::filesystem::path &p) |
applies the required action if file or folder, and browse its children More... | |
Abstract class used to crawl a directory.
The start method must be called to start crawling. Every time a folder is found, WsDirectoryCrawler::applyFolder is called. Every time a file is found, WsDirectoryCrawler::applyFile is called The pure virtual methods must be redefined in subclass
Definition at line 30 of file WsDirectoryCrawler.h.
WsDirectoryCrawler::WsDirectoryCrawler | ( | const std::string & | path | ) |
Class constructor, this class is Abstract and must therefore be inherited.
Definition at line 16 of file WsDirectoryCrawler.cpp.
|
pure virtual |
Virtual destructor.
Definition at line 21 of file WsDirectoryCrawler.cpp.
|
protectedpure virtual |
this method is called by browse when the boost::filesystem::path is a folder
Implemented in WsFileSystemTree.
|
protectedpure virtual |
this method is called by browse when the boost::filesystem::path is a file
Implemented in WsFileSystemTree.
|
protectedpure virtual |
this method is called before browsing a subdirectory
Implemented in WsFileSystemTree.
|
private |
applies the required action if file or folder, and browse its children
Definition at line 41 of file WsDirectoryCrawler.cpp.
|
protectedpure virtual |
this method is called when finished browsing the subdir
Implemented in WsFileSystemTree.
int WsDirectoryCrawler::start | ( | ) |
Start crawling over all the files and directories/subdirectories.
Definition at line 25 of file WsDirectoryCrawler.cpp.
|
protected |
Boolean set to true if the WsDirectoryCrawler::start method has been called and completed successfully
Definition at line 83 of file WsDirectoryCrawler.h.
|
protected |
the boost::filesystem::path of the directory to crawl
Definition at line 58 of file WsDirectoryCrawler.h.