FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
#include <zipnode.h>
Public Member Functions | |
ZipNode (const std::string &name, ZipNode *parent=0) | |
constructor for creating a node More... | |
~ZipNode () | |
destructor More... | |
std::string | getName () const |
accessor for the name of this node More... | |
std::string | getFullName () const |
accessor for the absolute path name of this node More... | |
ZipContentType::Enum | getContentType () const |
accessor for the content type of this node More... | |
ZipNode * | getParent () const |
accessor for the parent node of this node will be NULL if this node has no parent More... | |
std::vector< ZipNode * > | getChildren (ZipContentType::Enum contentType=ZipContentType::All) const |
gives access to retrieve the children of this node More... | |
ZipNode * | getChild (const std::string &name, ZipContentType::Enum contentType=ZipContentType::All) const |
gives access to retrieving a specific child node by name More... | |
ZipNode * | addChild (const std::string &child) |
allows adding a child node to this node More... | |
void | removeChild (ZipNode *child) |
allows removing a child from this node More... | |
void | removeChild (const std::string &name) |
allows removing a child node by name More... | |
bool | isLeaf () const |
accessor for checking if this node has any children More... | |
bool | isBranch () const |
accessor for checking if this node has children More... | |
void | setZipEntryData (const ZipEntryData &entryData) |
sets the zip file entry information for this node in the zip archive More... | |
const ZipEntryData & | getZipEntryData () const |
accessor for the entry data associated with this node in the zip archive More... | |
Private Attributes | |
std::string | m_name |
ZipContentType::Enum | m_contentType |
ZipEntryData | m_entryData |
ZipNode * | m_parent |
ZipNodeContainer | m_fileChildren |
ZipNodeContainer | m_directoryChildren |
FIFE::ZipNode::ZipNode | ( | const std::string & | name, |
ZipNode * | parent = 0 |
||
) |
constructor for creating a node
name | the name of the node |
parent | the parent of this node, defaults to NULL |
Definition at line 68 of file zipnode.cpp.
References FIFE::ZipContentType::Directory, FIFE::ZipContentType::File, FIFE::HasExtension(), m_contentType, and m_name.
Referenced by addChild().
FIFE::ZipNode::~ZipNode | ( | ) |
destructor
Definition at line 83 of file zipnode.cpp.
References m_directoryChildren, and m_fileChildren.
ZipNode * FIFE::ZipNode::addChild | ( | const std::string & | child | ) |
allows adding a child node to this node
child | the name to add as a child node |
Definition at line 181 of file zipnode.cpp.
References FIFE::ZipContentType::Directory, FIFE::ZipContentType::File, getContentType(), m_directoryChildren, m_fileChildren, and ZipNode().
Referenced by FIFE::ZipTree::addNode().
ZipNode * FIFE::ZipNode::getChild | ( | const std::string & | name, |
ZipContentType::Enum | contentType = ZipContentType::All |
||
) | const |
gives access to retrieving a specific child node by name
name | the name of the child node to search for |
contentType | optional for filtering on the type of node to return |
Definition at line 147 of file zipnode.cpp.
References FIFE::ZipContentType::All, FIFE::ZipContentType::Directory, FIFE::ZipContentType::File, FIFE::HasExtension(), m_directoryChildren, and m_fileChildren.
Referenced by FIFE::ZipTree::addNode(), and FIFE::ZipTree::getNode().
std::vector< ZipNode * > FIFE::ZipNode::getChildren | ( | ZipContentType::Enum | contentType = ZipContentType::All | ) | const |
gives access to retrieve the children of this node
contentType | allows filtering on the type of nodes returned, |
Definition at line 123 of file zipnode.cpp.
References FIFE::ZipContentType::All, FIFE::ZipContentType::Directory, FIFE::ZipContentType::File, m_directoryChildren, and m_fileChildren.
Referenced by FIFE::ZipSource::listDirectories(), FIFE::ZipSource::listFiles(), and operator<<().
ZipContentType::Enum FIFE::ZipNode::getContentType | ( | ) | const |
accessor for the content type of this node
Definition at line 115 of file zipnode.cpp.
References m_contentType.
Referenced by addChild(), and removeChild().
std::string FIFE::ZipNode::getFullName | ( | ) | const |
accessor for the absolute path name of this node
Definition at line 100 of file zipnode.cpp.
References getFullName(), m_name, and m_parent.
Referenced by getFullName().
std::string FIFE::ZipNode::getName | ( | ) | const |
accessor for the name of this node
Definition at line 96 of file zipnode.cpp.
References m_name.
Referenced by operator<<().
ZipNode * FIFE::ZipNode::getParent | ( | ) | const |
accessor for the parent node of this node will be NULL if this node has no parent
Definition at line 119 of file zipnode.cpp.
References m_parent.
Referenced by FIFE::ZipTree::getNode().
const ZipEntryData & FIFE::ZipNode::getZipEntryData | ( | ) | const |
accessor for the entry data associated with this node in the zip archive
Definition at line 246 of file zipnode.cpp.
References m_entryData.
Referenced by FIFE::ZipSource::open().
bool FIFE::ZipNode::isBranch | ( | ) | const |
accessor for checking if this node has children
Definition at line 236 of file zipnode.cpp.
References isLeaf().
bool FIFE::ZipNode::isLeaf | ( | ) | const |
accessor for checking if this node has any children
Definition at line 231 of file zipnode.cpp.
References m_directoryChildren, and m_fileChildren.
Referenced by isBranch().
void FIFE::ZipNode::removeChild | ( | ZipNode * | child | ) |
allows removing a child from this node
child | the child node to remove |
Definition at line 198 of file zipnode.cpp.
References FIFE::ZipContentType::File, getContentType(), and m_fileChildren.
void FIFE::ZipNode::removeChild | ( | const std::string & | name | ) |
allows removing a child node by name
name | the name of the child to remove |
Definition at line 212 of file zipnode.cpp.
References FIFE::HasExtension(), m_directoryChildren, and m_fileChildren.
void FIFE::ZipNode::setZipEntryData | ( | const ZipEntryData & | entryData | ) |
sets the zip file entry information for this node in the zip archive
entryData | the entry data that goes with this node |
Definition at line 241 of file zipnode.cpp.
References m_entryData.
Referenced by FIFE::ZipSource::readFileToIndex().
|
private |
Definition at line 153 of file zipnode.h.
Referenced by getContentType(), and ZipNode().
|
private |
Definition at line 158 of file zipnode.h.
Referenced by addChild(), getChild(), getChildren(), isLeaf(), removeChild(), and ~ZipNode().
|
private |
Definition at line 154 of file zipnode.h.
Referenced by getZipEntryData(), and setZipEntryData().
|
private |
Definition at line 157 of file zipnode.h.
Referenced by addChild(), getChild(), getChildren(), isLeaf(), removeChild(), and ~ZipNode().
|
private |
Definition at line 152 of file zipnode.h.
Referenced by getFullName(), getName(), and ZipNode().
|
private |
Definition at line 156 of file zipnode.h.
Referenced by getFullName(), and getParent().