Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsAbstractTree.h
Go to the documentation of this file.
1 
15 #ifndef WS_ABSTRACT_TREE_H__
16 #define WS_ABSTRACT_TREE_H__
17 
20 
28 
29 protected:
30 
40  WsAbstractTree(FileSystemTreePtr fs, const std::set<std::string>& gid, const int& md, const path& rootPath, const std::string& stamp);
41 
51  WsAbstractTree(FileSystemTreePtr fs, const std::set<std::string>& gid, const int& md, const std::set<std::string>& names, const std::set<std::string>& ext, const path& rootPath, const std::string& stamp);
52 
61  WsAbstractTree(NodePtr n, const std::set<std::string>& gid, const int& md, const path& rootPath, const std::string& stamp);
62 
63 
73  WsAbstractTree(NodePtr n, const std::set<std::string>& gid, const int& md, const std::set<std::string>& names, const std::set<std::string>& ext, const path& rootPath, const std::string& stamp);
74 
79 
83  virtual int beginTraverseDir(NodePtr n);
84 
88  virtual int endTraverseDir(NodePtr n);
89 
93  virtual int traverseFile(NodePtr n);
94 
99 
104 
108  std::set<std::string> m_gid;
109 
113  std::set<std::string> m_exclNames;
114 
118  std::set<std::string> m_exclExt;
119 
124 
125 
130 
131 
136 
137 
141  std::string m_stamp;
142 
143 public:
149  virtual int build();
150 
155  virtual NodePtr getRoot();
156 
162  virtual path& getRootPath();
163 
169  virtual const std::string& getStamp();
170 
171 };
172 
173 #endif
boost::shared_ptr< WsAbstractNode > NodePtr
virtual const std::string & getStamp()
Get the stamp of the tree.
std::set< std::string > m_gid
the gids of the user
virtual path & getRootPath()
get the root path
path m_rootPath
The rootPath.
int m_maxDepth
The max depth of the tree (ie depth we don't want to exceed.
Abstract class representing an WsAccessTree or WsMenuTree.
Used to traverse the tree.
virtual int build()
Parses the fileSystemTree and builds the Tree containing only the nodes where the user has access...
Traverses the fileSystemTree.
virtual int traverseFile(NodePtr n)
Called when traversing a fileNode.
~WsAbstractTree()
Destructor.
virtual int beginTraverseDir(NodePtr n)
Called when a directory is being traversed.
WsAbstractTree(FileSystemTreePtr fs, const std::set< std::string > &gid, const int &md, const path &rootPath, const std::string &stamp)
Constructor for the Tree class.
boost::shared_ptr< WsFileSystemTree > FileSystemTreePtr
std::set< std::string > m_exclNames
The excluded names.
virtual NodePtr getRoot()
Returns the root node of the menuTree.
virtual int endTraverseDir(NodePtr n)
Called when a directory has been completely traversed. ie all subnodes(recursively all sub nodes of s...
int m_currentDepth
The current depth of the tree (ie number of levels)
std::set< std::string > m_exclExt
The excluded extensions.
Structure representing all the fs tree from the root.
NodePtr m_current
The current node (the current level):w.
NodePtr m_root
the root of the tree
std::string m_stamp
The stamp of the tree.