new BoostInfoTree()
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.
- Source:
Methods
addSubtree(treeName, newTree)
Insert a BoostInfoTree as a sub-tree with the given name.
Parameters:
Name | Type | Description |
---|---|---|
treeName |
string | The name of the new sub-tree. |
newTree |
BoostInfoTree | The sub-tree to add. |
- Source:
createSubtree(treeName, value) → {BoostInfoTree}
Create a new BoostInfo and insert it as a sub-tree with the given name.
Parameters:
Name | Type | Description |
---|---|---|
treeName |
string | The name of the new sub-tree. |
value |
string | The value associated with the new sub-tree. |
- Source:
Returns:
The created sub-tree.
- Type
- BoostInfoTree
find(treeName) → {Array.<BoostInfoTree>}
Use treeName to find the array of BoostInfoTree in this.subtrees.
Parameters:
Name | Type | Description |
---|---|---|
treeName |
string | The key in this.subtrees to search for. This does a flat search in subtrees_. It does not split by '/' into a path. |
- Source:
Returns:
A array of BoostInfoTree, or null if not found.
- Type
- Array.<BoostInfoTree>
get(key) → {Array.<BoostInfoTree>}
Look up using the key and return a list of the subtrees.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The key which may be a path separated with '/'. |
- Source:
Returns:
A new array with pointers to the subtrees.
- Type
- Array.<BoostInfoTree>
getFirstValue(key) → {string}
Look up using the key and return string value of the first subtree.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The key which may be a path separated with '/'. |
- Source:
Returns:
The string value or null if not found.
- Type
- string