BoostInfoTree is provided for compatibility with the Boost INFO property list format used in ndn-cxx. More...
#include <boost-info-parser.hpp>
Public Member Functions | |
| BoostInfoTree (const std::string &value="", BoostInfoTree *parent=0) | |
| void | addSubtree (const std::string &treeName, const ptr_lib::shared_ptr< BoostInfoTree > &newTree) |
| Insert a BoostInfoTree as a sub-tree with the given name. More... | |
| const BoostInfoTree & | createSubtree (const std::string &treeName, const std::string &value="") |
| Create a new BoostInfo and insert it as a sub-tree with the given name. More... | |
| std::vector< const BoostInfoTree * > | operator[] (const std::string &key) const |
| Look up using the key and return a list of the subtrees. More... | |
| const std::string * | getFirstValue (const std::string &key) const |
| Look up using the key and return string value of the first subtree. More... | |
| const std::string & | getValue () const |
| BoostInfoTree * | getParent () |
| BoostInfoTree * | getLastChild () |
| std::string | prettyPrint (int indentLevel=1) const |
BoostInfoTree is provided for compatibility with the Boost INFO property list format used in ndn-cxx.
Each node in the tree may have a name and a value as well as associated sub-trees. The sub-tree names are not unique, and so sub-trees are stored as dictionaries where the key is a sub-tree name and the values are the sub-trees sharing the same name.
Nodes can be accessed with a path syntax, as long as nodes in the path do not contain the path separator '/' in their names.
| void ndn::BoostInfoTree::addSubtree | ( | const std::string & | treeName, |
| const ptr_lib::shared_ptr< BoostInfoTree > & | newTree | ||
| ) |
Insert a BoostInfoTree as a sub-tree with the given name.
| treeName | The name of the new sub-tree. |
| newTree | The sub-tree to add. |
| const BoostInfoTree & ndn::BoostInfoTree::createSubtree | ( | const std::string & | treeName, |
| const std::string & | value = "" |
||
| ) |
Create a new BoostInfo and insert it as a sub-tree with the given name.
| treeName | The name of the new sub-tree. |
| value | The value associated with the new sub-tree. |
|
inline |
Look up using the key and return string value of the first subtree.
| key | The key which may be a path separated with '/'. |
| vector< const BoostInfoTree * > ndn::BoostInfoTree::operator[] | ( | const std::string & | key | ) | const |
Look up using the key and return a list of the subtrees.
| key | The key which may be a path separated with '/'. |
1.8.6