40 : m_rootNode(new
ZipNode(
"/")) {
49 bfs::path filePath(nodePath);
50 std::string filename = filePath.string();
55 if (filename[filename.length()-1] ==
'/') {
56 filename = filename.erase(filename.length()-1);
59 filePath = bfs::path(filename);
64 for (bfs::path::iterator iter = filePath.begin(); iter != filePath.end(); ++iter) {
66 tempNode = node->
getChild(pathString);
92 bfs::path filePath(name);
96 for (bfs::path::iterator iter = filePath.begin(); iter != filePath.end(); ++iter) {
99 if (pathString ==
".." && (node !=
getRootNode())) {
105 tempNode = node->
getChild(pathString);
ZipNode * addNode(const std::string &nodePath)
adds a node to the proper place in the tree based on the node path name
std::ostream & operator<<(std::ostream &os, const Location &l)
Stream output operator.
std::string GetPathIteratorAsString(const bfs::path::iterator &pathIter)
Helper function to retrieve the path iterator in a string representation.
ZipNode * getParent() const
accessor for the parent node of this node will be NULL if this node has no parent ...
ZipNode * getNode(const std::string &name) const
accessor for getting a node by name
ZipNode * addChild(const std::string &child)
allows adding a child node to this node
ZipNode * getRootNode() const
accessor for the root node of the tree mostly used for debugging purposes
ZipNode * getChild(const std::string &name, ZipContentType::Enum contentType=ZipContentType::All) const
gives access to retrieving a specific child node by name