Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
WsDirectoryCrawler Class Referenceabstract

Abstract class used to crawl a directory. More...

#include <WsDirectoryCrawler.h>

Inheritance diagram for WsDirectoryCrawler:
Inheritance graph
Collaboration diagram for WsDirectoryCrawler:
Collaboration graph

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

WsDirectoryCrawler::~WsDirectoryCrawler ( )
pure virtual

Virtual destructor.

Definition at line 21 of file WsDirectoryCrawler.cpp.

Member Function Documentation

virtual int WsDirectoryCrawler::applyDirectory ( const boost::filesystem::path &  p)
protectedpure virtual

this method is called by browse when the boost::filesystem::path is a folder

Implemented in WsFileSystemTree.

Here is the caller graph for this function:

virtual int WsDirectoryCrawler::applyFile ( const boost::filesystem::path &  p)
protectedpure virtual

this method is called by browse when the boost::filesystem::path is a file

Implemented in WsFileSystemTree.

Here is the caller graph for this function:

virtual void WsDirectoryCrawler::beginChild ( const boost::filesystem::path &  p)
protectedpure virtual

this method is called before browsing a subdirectory

Implemented in WsFileSystemTree.

Here is the caller graph for this function:

int WsDirectoryCrawler::browse ( const boost::filesystem::path &  p)
private

applies the required action if file or folder, and browse its children

Definition at line 41 of file WsDirectoryCrawler.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void WsDirectoryCrawler::endChild ( const boost::filesystem::path &  p)
protectedpure virtual

this method is called when finished browsing the subdir

Implemented in WsFileSystemTree.

Here is the caller graph for this function:

int WsDirectoryCrawler::start ( )

Start crawling over all the files and directories/subdirectories.

Definition at line 25 of file WsDirectoryCrawler.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool WsDirectoryCrawler::m_isLoaded
protected

Boolean set to true if the WsDirectoryCrawler::start method has been called and completed successfully

Definition at line 83 of file WsDirectoryCrawler.h.

std::string WsDirectoryCrawler::m_p
protected

the boost::filesystem::path of the directory to crawl

Definition at line 58 of file WsDirectoryCrawler.h.


The documentation for this class was generated from the following files: