82 if (!dynamic_cast<WsDirNode*>(n.get())->isAllowed(
m_gid)) {
93 if (dynamic_cast<WsDirNode*>(n.get())->isAllowed(
m_gid)) {
95 if (
m_exclNames.count(n.get()->getFullPath().stem().string()) > 0) {
96 LOG(
DEBUG) <<
"WsAbstractTree::beginTraverseDir() : Excluding node " << n.get()->getFullPath();
100 nn.get()->setProperties(n.get()->getProperties());
102 LOG(
DEBUG) <<
"WsAbstractTree::beginTraverseDir() : Excluding node " << n.get()->getFullPath();
111 LOG(
DEBUG) <<
"WsAbstractTree::beginTraverseDir() : Not allowed to access " << n->getPath();
133 if (
m_exclNames.count(n.get()->getFullPath().stem().string()) > 0) {
134 LOG(
DEBUG) <<
"WsAbstractTree::traverseFile() : Excluding node " << n.get()->getFullPath();
137 if (
m_exclExt.count(n.get()->getFullPath().extension().string()) > 0) {
138 LOG(
DEBUG) <<
"WsAbstractTree::traverseFile() : Excluding node " << n.get()->getFullPath();
142 nn.get()->setProperties(n.get()->getProperties());
143 nn.get()->setCreateDate(dynamic_cast<WsFileNode*>(n.get())->getCreateDate());
144 nn.get()->setModifyDate(dynamic_cast<WsFileNode*>(n.get())->getModifyDate());
145 nn.get()->setSize(dynamic_cast<WsFileNode*>(n.get())->getSize());
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
Reprensents a Directory on disk.
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.
Reprensents a File on disk.
Used to traverse the tree.
virtual int build()
Parses the fileSystemTree and builds the Tree containing only the nodes where the user has access...
Reprensents the tree of a group. If a group does not have access to a Node, this Node will not show i...
virtual int traverseFile(NodePtr n)
Called when traversing a fileNode.
~WsAbstractTree()
Destructor.
int start()
start traversing the Tree.
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.
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.