13 #ifndef WS_FILESYSTEM_TREE_H__
14 #define WS_FILESYSTEM_TREE_H__
15 #define BOOST_FILESYSTEM_NO_DEPRECATED
24 #include <boost/thread/mutex.hpp>
25 #include <boost/shared_ptr.hpp>
110 int applyFile(
const boost::filesystem::path& filePath);
121 void beginChild(
const boost::filesystem::path& p);
126 void endChild(
const boost::filesystem::path& p);
const std::string & getStamp()
returns the Tree unique stamp
Abstract class used to crawl a directory.
Represents the file structure on disk.
boost::shared_ptr< WsAbstractNode > NodePtr
WsFileSystemTree(const std::string &p, bool m=false)
Constructor for the FileSystemTree object.
std::vector< boost::filesystem::path > m_monitorPaths
int start()
crawls the diretory and sorts the children. It is called by WsDirectoryCrawler::start() ...
NodePtr getRoot()
returns the root of the WsFileSystemTree
Fetch a directory and all subdirs.
NodePtr eatPath(const std::string &p)
Node structure, must be inherited.
void endChild(const boost::filesystem::path &p)
this method is called when finished browsing the subdir
const boost::filesystem::path & getRootPath() const
returns the boost::filesystem::path to the base directory where documents are stored ...
int getUseCount()
returns the number of users that are using this fileSystemTree version
int applyDirectory(const boost::filesystem::path &dirPath)
this method is called by browse when the boost::filesystem::path is a folder
void incrementUseCount()
increments the number of uses of the tree by 1
boost::shared_ptr< WsFileSystemTree > FileSystemTreePtr
int applyFile(const boost::filesystem::path &filePath)
this method is called by browse when the boost::filesystem::path is a file
boost::filesystem::path m_rootPath
int insertNode(NodePtr newNode)
inserts the node in the tree The node is inserted on the right place on the tree depending on it's pa...
std::vector< boost::filesystem::path > & getMonitorPaths()
returns the std::vector containing the boost::filesystem::path that should be monitored by the WsUpda...
void decrementUseCount()
decrements the numbers of uses by one
void createStamp()
creates unique stamp for the tree
void beginChild(const boost::filesystem::path &p)
this method is called before browsing a subdirectory