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

Reprensents an access tree. More...

#include <WsAccessTree.h>

Inheritance diagram for WsAccessTree:
Inheritance graph
Collaboration diagram for WsAccessTree:
Collaboration graph

Public Member Functions

 WsAccessTree (FileSystemTreePtr fs, const std::set< std::string > &gid, const int &md, const path &rootPath, const std::string &stamp)
 Constructor for the AccessTree class. More...
 
 WsAccessTree (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)
 Constructor for the AccessTree class. More...
 
 WsAccessTree (NodePtr n, const std::set< std::string > &gid, const int &md, const path &rootPath, const std::string &stamp)
 Constructor for the AccessTree class. More...
 
 WsAccessTree (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)
 Constructor for the AccessTree class. More...
 
virtual int build ()
 Parses the fileSystemTree and builds the Tree containing only the nodes where the user has access. More...
 
virtual NodePtr getRoot ()
 Returns the root node of the menuTree. More...
 
virtual path & getRootPath ()
 get the root path More...
 
virtual const std::string & getStamp ()
 Get the stamp of the tree. More...
 
int start ()
 start traversing the Tree. More...
 

Protected Member Functions

virtual int beginTraverseDir (NodePtr n)
 Called when a directory is being traversed. More...
 
virtual int endTraverseDir (NodePtr n)
 Called when a directory has been completely traversed. ie all subnodes(recursively all sub nodes of subnodes etc..) have been traversed. More...
 
virtual int traverseFile (NodePtr n)
 Called when traversing a fileNode. More...
 

Protected Attributes

NodePtr m_root
 the root of the tree More...
 
NodePtr m_current
 The current node (the current level):w. More...
 
std::set< std::string > m_gid
 the gids of the user More...
 
std::set< std::string > m_exclNames
 The excluded names. More...
 
std::set< std::string > m_exclExt
 The excluded extensions. More...
 
path m_rootPath
 The rootPath. More...
 
int m_currentDepth
 The current depth of the tree (ie number of levels) More...
 
int m_maxDepth
 The max depth of the tree (ie depth we don't want to exceed. More...
 
std::string m_stamp
 The stamp of the tree. More...
 

Detailed Description

Reprensents an access tree.

The access tree contains all the items the user has access to

Definition at line 24 of file WsAccessTree.h.

Constructor & Destructor Documentation

WsAccessTree::WsAccessTree ( FileSystemTreePtr  fs,
const std::set< std::string > &  gid,
const int &  md,
const path &  rootPath,
const std::string &  stamp 
)

Constructor for the AccessTree class.

Parameters
fsthe fileSystemTree to use
gida std::set of group names/ids of the user
mdmax depth default is no max depth (0)
WsAccessTree::WsAccessTree ( 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 
)

Constructor for the AccessTree class.

Parameters
fsthe fileSystemTree to use
gida std::set of group names/ids of the user
namesthe excluded names
extthe excluded extensions
WsAccessTree::WsAccessTree ( NodePtr  n,
const std::set< std::string > &  gid,
const int &  md,
const path &  rootPath,
const std::string &  stamp 
)

Constructor for the AccessTree class.

Parameters
nthe Root node
gida std::set of group names/ids of the user
mdmax depth default is no max depth (0)
WsAccessTree::WsAccessTree ( 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 
)

Constructor for the AccessTree class.

Parameters
nthe root node
gida std::set of group names/ids of the user
namesthe excluded names
extthe excluded extensions

Member Function Documentation

int WsAbstractTree::beginTraverseDir ( NodePtr  n)
protectedvirtualinherited

Called when a directory is being traversed.

Parameters
nthe NodePtr representing the directory being traversed
Returns
SUCCESS or FAILURE if an error occured

Implements WsTreeTraversal.

Definition at line 76 of file WsAbstractTree.cpp.

int WsAbstractTree::build ( )
virtualinherited

Parses the fileSystemTree and builds the Tree containing only the nodes where the user has access.

Returns
SUCCESS if the tree was built without errors, FAILURE otherwise

Definition at line 66 of file WsAbstractTree.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int WsAbstractTree::endTraverseDir ( NodePtr  n)
protectedvirtualinherited

Called when a directory has been completely traversed. ie all subnodes(recursively all sub nodes of subnodes etc..) have been traversed.

Parameters
nThe NodePtr representing the directory that has been completely traversed
Returns
SUCCESS or FAILURE

Implements WsTreeTraversal.

Definition at line 121 of file WsAbstractTree.cpp.

NodePtr WsAbstractTree::getRoot ( )
virtualinherited

Returns the root node of the menuTree.

Returns
Pointer to the root of the menuTree

Definition at line 71 of file WsAbstractTree.cpp.

Here is the caller graph for this function:

path & WsAbstractTree::getRootPath ( )
virtualinherited

get the root path

Returns
boost::filesystem::path representing the rootPath

Definition at line 157 of file WsAbstractTree.cpp.

const string & WsAbstractTree::getStamp ( )
virtualinherited

Get the stamp of the tree.

Returns
A std::string containing the stamp

Definition at line 162 of file WsAbstractTree.cpp.

int WsTreeTraversal::start ( )
inherited

start traversing the Tree.

Definition at line 21 of file WsTreeTraversal.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int WsAbstractTree::traverseFile ( NodePtr  n)
protectedvirtualinherited

Called when traversing a fileNode.

Parameters
nA NodePtr representing the file being traversed
Returns
SUCCESS or FAILURE

Implements WsTreeTraversal.

Definition at line 129 of file WsAbstractTree.cpp.

Member Data Documentation

NodePtr WsAbstractTree::m_current
protectedinherited

The current node (the current level):w.

Definition at line 103 of file WsAbstractTree.h.

int WsAbstractTree::m_currentDepth
protectedinherited

The current depth of the tree (ie number of levels)

Definition at line 129 of file WsAbstractTree.h.

std::set<std::string> WsAbstractTree::m_exclExt
protectedinherited

The excluded extensions.

Definition at line 118 of file WsAbstractTree.h.

std::set<std::string> WsAbstractTree::m_exclNames
protectedinherited

The excluded names.

Definition at line 113 of file WsAbstractTree.h.

std::set<std::string> WsAbstractTree::m_gid
protectedinherited

the gids of the user

Definition at line 108 of file WsAbstractTree.h.

int WsAbstractTree::m_maxDepth
protectedinherited

The max depth of the tree (ie depth we don't want to exceed.

Definition at line 135 of file WsAbstractTree.h.

NodePtr WsAbstractTree::m_root
protectedinherited

the root of the tree

Definition at line 98 of file WsAbstractTree.h.

path WsAbstractTree::m_rootPath
protectedinherited

The rootPath.

Definition at line 123 of file WsAbstractTree.h.

std::string WsAbstractTree::m_stamp
protectedinherited

The stamp of the tree.

Definition at line 141 of file WsAbstractTree.h.


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