FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::ZipNode Class Reference

#include <zipnode.h>

+ Collaboration diagram for FIFE::ZipNode:

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...
 
ZipNodegetParent () 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...
 
ZipNodegetChild (const std::string &name, ZipContentType::Enum contentType=ZipContentType::All) const
 gives access to retrieving a specific child node by name More...
 
ZipNodeaddChild (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 ZipEntryDatagetZipEntryData () 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
 
ZipNodem_parent
 
ZipNodeContainer m_fileChildren
 
ZipNodeContainer m_directoryChildren
 

Detailed Description

Definition at line 64 of file zipnode.h.

Constructor & Destructor Documentation

FIFE::ZipNode::ZipNode ( const std::string &  name,
ZipNode parent = 0 
)

constructor for creating a node

Parameters
namethe name of the node
parentthe parent of this node, defaults to NULL

Definition at line 67 of file zipnode.cpp.

References FIFE::ZipContentType::Directory, FIFE::ZipContentType::File, FIFE::HasExtension(), m_contentType, and m_name.

Referenced by addChild().

+ Here is the caller graph for this function:

FIFE::ZipNode::~ZipNode ( )

destructor

Definition at line 82 of file zipnode.cpp.

References m_directoryChildren, and m_fileChildren.

Member Function Documentation

ZipNode * FIFE::ZipNode::addChild ( const std::string &  child)

allows adding a child node to this node

Note
this should only be used internally by the FIFE zip classes
Parameters
childthe name to add as a child node
Returns
the newly created child ZipNode

Definition at line 180 of file zipnode.cpp.

References FIFE::ZipContentType::Directory, FIFE::ZipContentType::File, getContentType(), m_directoryChildren, m_fileChildren, and ZipNode().

Referenced by FIFE::ZipTree::addNode().

+ Here is the caller graph for this function:

ZipNode * FIFE::ZipNode::getChild ( const std::string &  name,
ZipContentType::Enum  contentType = ZipContentType::All 
) const

gives access to retrieving a specific child node by name

Parameters
namethe name of the child node to search for
contentTypeoptional for filtering on the type of node to return
Returns
the ZipNode pointer matching the child (NULL if not found)

Definition at line 146 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().

+ Here is the caller graph for this function:

std::vector< ZipNode * > FIFE::ZipNode::getChildren ( ZipContentType::Enum  contentType = ZipContentType::All) const

gives access to retrieve the children of this node

Parameters
contentTypeallows filtering on the type of nodes returned,
See also
ZipContentType for description
Returns
vector of ZipNode pointers matching the request

Definition at line 122 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<<().

+ Here is the caller graph for this function:

ZipContentType::Enum FIFE::ZipNode::getContentType ( ) const

accessor for the content type of this node

Returns
ZipContentType enumeration

Definition at line 114 of file zipnode.cpp.

References m_contentType.

Referenced by addChild(), and removeChild().

+ Here is the caller graph for this function:

std::string FIFE::ZipNode::getFullName ( ) const

accessor for the absolute path name of this node

Definition at line 99 of file zipnode.cpp.

References getFullName(), m_name, and m_parent.

Referenced by getFullName().

+ Here is the caller graph for this function:

std::string FIFE::ZipNode::getName ( ) const

accessor for the name of this node

Definition at line 95 of file zipnode.cpp.

References m_name.

Referenced by operator<<().

+ Here is the caller graph for this function:

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 118 of file zipnode.cpp.

References m_parent.

Referenced by FIFE::ZipTree::getNode().

+ Here is the caller graph for this function:

const ZipEntryData & FIFE::ZipNode::getZipEntryData ( ) const

accessor for the entry data associated with this node in the zip archive

Returns
ZipEntryData for this node

Definition at line 245 of file zipnode.cpp.

References m_entryData.

Referenced by FIFE::ZipSource::open().

+ Here is the caller graph for this function:

bool FIFE::ZipNode::isBranch ( ) const

accessor for checking if this node has children

Returns
true if node has children false if node does not have children

Definition at line 235 of file zipnode.cpp.

References isLeaf().

bool FIFE::ZipNode::isLeaf ( ) const

accessor for checking if this node has any children

Returns
true if node has no children false if node has children

Definition at line 230 of file zipnode.cpp.

References m_directoryChildren, and m_fileChildren.

Referenced by isBranch().

+ Here is the caller graph for this function:

void FIFE::ZipNode::removeChild ( ZipNode child)

allows removing a child from this node

Parameters
childthe child node to remove

Definition at line 197 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

Parameters
namethe name of the child to remove

Definition at line 211 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

Parameters
entryDatathe entry data that goes with this node

Definition at line 240 of file zipnode.cpp.

References m_entryData.

Referenced by FIFE::ZipSource::readFileToIndex().

+ Here is the caller graph for this function:

Member Data Documentation

ZipContentType::Enum FIFE::ZipNode::m_contentType
private

Definition at line 153 of file zipnode.h.

Referenced by getContentType(), and ZipNode().

ZipNodeContainer FIFE::ZipNode::m_directoryChildren
private

Definition at line 158 of file zipnode.h.

Referenced by addChild(), getChild(), getChildren(), isLeaf(), removeChild(), and ~ZipNode().

ZipEntryData FIFE::ZipNode::m_entryData
private

Definition at line 154 of file zipnode.h.

Referenced by getZipEntryData(), and setZipEntryData().

ZipNodeContainer FIFE::ZipNode::m_fileChildren
private

Definition at line 157 of file zipnode.h.

Referenced by addChild(), getChild(), getChildren(), isLeaf(), removeChild(), and ~ZipNode().

std::string FIFE::ZipNode::m_name
private

Definition at line 152 of file zipnode.h.

Referenced by getFullName(), getName(), and ZipNode().

ZipNode* FIFE::ZipNode::m_parent
private

Definition at line 156 of file zipnode.h.

Referenced by getFullName(), and getParent().


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