Wittyshare
0.2
|
Reprensents a Directory on disk. More...
#include <WsDirNode.h>
Public Types | |
enum | ResourceType { Icones, Images, Templates } |
Public Member Functions | |
WsDirNode (const path &fullPath, const path &rootPath) | |
Constructor for DirNode. More... | |
WsDirNode () | |
~WsDirNode () | |
bool | isAllowed (const std::set< string > &gids) |
return true if one of the groups contained in gids has access to the node false otherwise If the node is retrieved from the daemon use WsUser::isAllowed instead More... | |
bool | getDisplayInParent () |
set< string > | getGroups () |
returns the list of the groups allowed to access this node More... | |
std::vector< std::string > | getResource (ResourceType t, bool recurse=false) |
get the resource of a node Not implemented yet More... | |
void | setResources (WsNodeResources *resources) |
bool | isDirectory () |
return true More... | |
bool | isRegularFile () |
return false More... | |
const uintmax_t | getSize () |
returns the file size. If the Node is a WsDirNode, 0 is returned. if the global property dir_size is set to true, the number of items in the node is returned (one level) More... | |
const path & | getPath () |
returns the relative path of the node More... | |
const path & | getFullPath () |
returns the full path of the node More... | |
string | getName (const bool noExt=false) |
returns the name of the node More... | |
const string | getDisplayName (const bool noExt=false) |
returns the display name of the node More... | |
int | addChildDirectory (NodePtr f) |
adds a node as a child directory The Directory is added to the WsAbstractNode::m_dirVect More... | |
int | addChildFile (NodePtr f) |
adds a node as a child file The Directory is added to the WsAbstractNode::m_fileVect More... | |
int | addChildNode (NodePtr f) |
add a Node to the combined vect WsAbstractNode::m_combinedVect More... | |
void | setParent (NodePtr n) |
sets the parent of the node represented by this More... | |
NodePtr | getParent () |
returns the parent node of this More... | |
const vector< NodePtr > | getFiles () |
returns the list of all the file contained in the directory represented by this More... | |
const vector< NodePtr > | getDirectories () |
returns the list of all the file contained in the file reprensented by this More... | |
const vector< NodePtr > | getAll () |
combine the vector of files and directories into a single one More... | |
NodePtr | getNodeByName (const std::string &name) |
Searches for the NodePtr reprenting the filename. More... | |
bool | getDisplayInMenu () |
returns true if the item should be displayed in the menu. This value is set in the configuration file of the node More... | |
void | setProperties (NodePropertiesPtr properties) |
set the properties of the node. The properties are a WsAbstractProperties object. More... | |
NodePropertiesPtr | getProperties () |
get the properties of the node If the properties are not set (no conf found, or node retrieved from server) empty properties are returned. To get the properties for a node retrieved from server use WsUser::getProperties More... | |
std::string | getProperty (const std::string §ion, const std::string &id, const std::string &def, bool recurse=false) |
get a node property reprensented by section/id If no value found, the value def is returned More... | |
void | sort () |
sort the nodes using the sort number or the name if not provided More... | |
const time_t & | getModifyDate () |
returns the modification date of the file reprenseted by the node More... | |
const time_t & | getCreateDate () |
WsAbstractNode::getCreateDate() More... | |
void | setCreateDate (const time_t &t) |
sets the creation date of the file. This method does not change the actual creation date of the file represented by the node More... | |
void | setModifyDate (const time_t &t) |
sets the modification date of the file. This method does not change the actual modification date of the file represented by the node More... | |
void | setSize (const uintmax_t &size) |
sets the file size in the node. Typically called by WsFileSystemTree when building the FileSystemTree More... | |
NodePtr | eatPath (const std::string &path) |
resolves the path and returns the node reprenseted by this path The path should be starting from the rootPath otherwise the method won't be able to resolve it. More... | |
Public Attributes | |
WNodePtr | m_parent |
vector< NodePtr > | m_fileVect |
vector< NodePtr > | m_dirVect |
vector< NodePtr > | m_combinedVect |
path | m_fullPath |
path | m_relPath |
uintmax_t | m_size |
Protected Attributes | |
NodePropertiesPtr | m_properties |
time_t | m_createTime |
time_t | m_modifyTime |
boost::mutex * | m_mutexSort |
Private Attributes | |
WsNodeResources * | m_resources |
Reprensents a Directory on disk.
Definition at line 25 of file WsDirNode.h.
|
inherited |
WsDirNode::WsDirNode | ( | const path & | fullPath, |
const path & | rootPath | ||
) |
Constructor for DirNode.
fullPath | the fullPath of the node |
rootPath | the rootPath (ie the directory of the site) |
Definition at line 17 of file WsDirNode.cpp.
WsDirNode::WsDirNode | ( | ) |
Definition at line 23 of file WsDirNode.cpp.
WsDirNode::~WsDirNode | ( | ) |
Definition at line 29 of file WsDirNode.cpp.
|
virtualinherited |
adds a node as a child directory The Directory is added to the WsAbstractNode::m_dirVect
f | a NodePtr of the WsAbstractNode representing the directory |
Implements WsAbstractNode.
Definition at line 47 of file WsNode.cpp.
|
virtualinherited |
adds a node as a child file The Directory is added to the WsAbstractNode::m_fileVect
f | a NodePtr of the WsAbstractNode representing the file |
Implements WsAbstractNode.
Definition at line 60 of file WsNode.cpp.
|
virtualinherited |
add a Node to the combined vect WsAbstractNode::m_combinedVect
f | a NodePtr of the WsAbstractNode representing the file or directory |
Implements WsAbstractNode.
Definition at line 73 of file WsNode.cpp.
|
virtualinherited |
resolves the path and returns the node reprenseted by this path The path should be starting from the rootPath otherwise the method won't be able to resolve it.
path | the path of the node we are searching starting from the rootPath |
Implements WsAbstractNode.
Definition at line 207 of file WsNode.cpp.
|
virtualinherited |
combine the vector of files and directories into a single one
Implements WsAbstractNode.
Definition at line 130 of file WsNode.cpp.
|
virtualinherited |
WsAbstractNode::getCreateDate()
Implements WsAbstractNode.
Definition at line 244 of file WsNode.cpp.
|
virtualinherited |
returns the list of all the file contained in the file reprensented by this
Implements WsAbstractNode.
Definition at line 124 of file WsNode.cpp.
|
virtualinherited |
returns true if the item should be displayed in the menu. This value is set in the configuration file of the node
Implements WsAbstractNode.
Definition at line 156 of file WsNode.cpp.
bool WsDirNode::getDisplayInParent | ( | ) |
Definition at line 78 of file WsDirNode.cpp.
|
virtualinherited |
returns the display name of the node
Implements WsAbstractNode.
Definition at line 111 of file WsNode.cpp.
|
virtualinherited |
returns the list of all the file contained in the directory represented by this
Implements WsAbstractNode.
Definition at line 118 of file WsNode.cpp.
|
virtualinherited |
returns the full path of the node
Implements WsAbstractNode.
Definition at line 99 of file WsNode.cpp.
set< string > WsDirNode::getGroups | ( | ) |
returns the list of the groups allowed to access this node
Definition at line 36 of file WsDirNode.cpp.
|
virtualinherited |
returns the modification date of the file reprenseted by the node
Implements WsAbstractNode.
Definition at line 239 of file WsNode.cpp.
|
virtualinherited |
returns the name of the node
Implements WsAbstractNode.
Definition at line 104 of file WsNode.cpp.
|
virtualinherited |
Searches for the NodePtr reprenting the filename.
name | the name of the node with the extension |
Implements WsAbstractNode.
Definition at line 138 of file WsNode.cpp.
|
virtualinherited |
returns the parent node of this
Implements WsAbstractNode.
Definition at line 88 of file WsNode.cpp.
|
virtualinherited |
returns the relative path of the node
Implements WsAbstractNode.
Definition at line 94 of file WsNode.cpp.
|
virtualinherited |
get the properties of the node If the properties are not set (no conf found, or node retrieved from server) empty properties are returned. To get the properties for a node retrieved from server use WsUser::getProperties
Implements WsAbstractNode.
Definition at line 175 of file WsNode.cpp.
|
virtualinherited |
get a node property reprensented by section/id If no value found, the value def is returned
section | the section of the key we are searching |
id | the key we are searching |
def | the default value to return if not found |
recurse | if set to true and no value found , the method will look for parent values until a value is found. |
Implements WsAbstractNode.
Definition at line 180 of file WsNode.cpp.
vector< string > WsDirNode::getResource | ( | ResourceType | t, |
bool | recurse = false |
||
) |
get the resource of a node Not implemented yet
Definition at line 69 of file WsDirNode.cpp.
|
virtual |
returns the file size. If the Node is a WsDirNode, 0 is returned. if the global property dir_size is set to true, the number of items in the node is returned (one level)
Implements WsNode.
Definition at line 96 of file WsDirNode.cpp.
|
virtual |
return true if one of the groups contained in gids has access to the node false otherwise If the node is retrieved from the daemon use WsUser::isAllowed instead
gids | a set of gids (Typically the gids of a user |
Implements WsAbstractNode.
Definition at line 41 of file WsDirNode.cpp.
|
virtual |
|
virtual |
|
virtualinherited |
sets the creation date of the file. This method does not change the actual creation date of the file represented by the node
Implements WsAbstractNode.
Definition at line 249 of file WsNode.cpp.
|
virtualinherited |
sets the modification date of the file. This method does not change the actual modification date of the file represented by the node
Implements WsAbstractNode.
Definition at line 254 of file WsNode.cpp.
|
virtualinherited |
sets the parent of the node represented by this
n | the parent node that is a NodePtr representing a WsDirNode |
Implements WsAbstractNode.
Definition at line 83 of file WsNode.cpp.
|
virtualinherited |
set the properties of the node. The properties are a WsAbstractProperties object.
properties | w WsNodeProperties representing the properties of the node. The object should be instanciated and values set in it |
Implements WsAbstractNode.
Definition at line 165 of file WsNode.cpp.
void WsDirNode::setResources | ( | WsNodeResources * | resources | ) |
Definition at line 73 of file WsDirNode.cpp.
|
virtualinherited |
sets the file size in the node. Typically called by WsFileSystemTree when building the FileSystemTree
Implements WsAbstractNode.
Definition at line 170 of file WsNode.cpp.
|
virtualinherited |
sort the nodes using the sort number or the name if not provided
Implements WsAbstractNode.
Definition at line 192 of file WsNode.cpp.
|
inherited |
A combined vector of WsAbstractNode::m_fileVect and WsAbstractNode::m_dirVect It is built in the WsAbstractNode::sort() method
Definition at line 258 of file WsAbstractNode.h.
|
protectedinherited |
|
inherited |
The std::vector containing the children directories of the Node represented by this
Definition at line 253 of file WsAbstractNode.h.
|
inherited |
The std::vector containing the children files of the Node represented by this
Definition at line 249 of file WsAbstractNode.h.
|
inherited |
The full path of the Node (ie the rootPath + m_relPath)
Definition at line 262 of file WsAbstractNode.h.
|
protectedinherited |
|
inherited |
The parent Node
Definition at line 245 of file WsAbstractNode.h.
|
protectedinherited |
|
inherited |
The relative path of the Node (ie the path starting from the rootPath
Definition at line 266 of file WsAbstractNode.h.
|
private |
Contained the resources of the node
Definition at line 80 of file WsDirNode.h.
|
inherited |
The size of the file represented by the node on disk
Definition at line 270 of file WsAbstractNode.h.