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
WsAbstractTree Class Reference

Abstract class representing an WsAccessTree or WsMenuTree. More...

#include <WsAbstractTree.h>

Inheritance diagram for WsAbstractTree:
Inheritance graph
Collaboration diagram for WsAbstractTree:
Collaboration graph

Public Member Functions

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

 WsAbstractTree (FileSystemTreePtr fs, const std::set< std::string > &gid, const int &md, const path &rootPath, const std::string &stamp)
 Constructor for the Tree class. More...
 
 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)
 Constructor for the Tree class. More...
 
 WsAbstractTree (NodePtr n, const std::set< std::string > &gid, const int &md, const path &rootPath, const std::string &stamp)
 Constructor for the Tree class. More...
 
 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)
 Constructor for the Tree class. More...
 
 ~WsAbstractTree ()
 Destructor. More...
 
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

Abstract class representing an WsAccessTree or WsMenuTree.

This class should be derived and is used as parent for WsAccessTree and WsMenuTree

Definition at line 27 of file WsAbstractTree.h.

Constructor & Destructor Documentation

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

Constructor for the Tree class.

Parameters
fsthe fileSystemTree to use
gida std::set of group names/ids of the user
mdmax depth default is no max depth (0)
rootPaththe root path
stampthe unique stamp of the tree
WsAbstractTree::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 
)
protected

Constructor for the Tree class.

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

Constructor for the Tree class.

Parameters
nthe Root node of the tree
gida std::set of group names/ids of the user
mdmax depth default is no max depth (0)
rootPaththe root path
stampthe unique stamp of the tree
WsAbstractTree::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 
)
protected

Constructor for the Tree class.

Parameters
nthe root node
gida std::set of group names/ids of the user
namesthe excluded names
extthe excluded extensions
rootPaththe root path
stampthe unique stamp of the tree
WsAbstractTree::~WsAbstractTree ( )
protected

Destructor.

Definition at line 62 of file WsAbstractTree.cpp.

Member Function Documentation

int WsAbstractTree::beginTraverseDir ( NodePtr  n)
protectedvirtual

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 ( )
virtual

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)
protectedvirtual

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 ( )
virtual

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 ( )
virtual

get the root path

Returns
boost::filesystem::path representing the rootPath

Definition at line 157 of file WsAbstractTree.cpp.

const string & WsAbstractTree::getStamp ( )
virtual

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)
protectedvirtual

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
protected

The current node (the current level):w.

Definition at line 103 of file WsAbstractTree.h.

int WsAbstractTree::m_currentDepth
protected

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
protected

The excluded extensions.

Definition at line 118 of file WsAbstractTree.h.

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

The excluded names.

Definition at line 113 of file WsAbstractTree.h.

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

the gids of the user

Definition at line 108 of file WsAbstractTree.h.

int WsAbstractTree::m_maxDepth
protected

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
protected

the root of the tree

Definition at line 98 of file WsAbstractTree.h.

path WsAbstractTree::m_rootPath
protected

The rootPath.

Definition at line 123 of file WsAbstractTree.h.

std::string WsAbstractTree::m_stamp
protected

The stamp of the tree.

Definition at line 141 of file WsAbstractTree.h.


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