VPTissue Reference Manual
|
A collection of functions for manipulating the structure of ptrees. More...
#include <PTreeUtils.h>
Static Public Member Functions | |
static void | CopyNonExistingChildren (const boost::property_tree::ptree &src, boost::property_tree::ptree &dst, const std::set< std::string > &ignore=std::set< std::string >()) |
Copies every node from 'source' ptree if that node doesn't exist in 'destination' ptree. More... | |
static void | CopyStructure (const boost::property_tree::ptree &src, boost::property_tree::ptree &dst, const std::string &fill_value, const std::set< std::string > &ignore=std::set< std::string >()) |
static void | FillPTree (boost::property_tree::ptree &pt1, const boost::property_tree::ptree &pt2) |
Fill the first ptree with the second ptree. More... | |
static std::list< std::pair< std::string, std::string > > | Flatten (const boost::property_tree::ptree &pt, bool indexedArray=false, const std::string &path="") |
Flattens a ptree from a given path. More... | |
static const boost::property_tree::ptree & | GetIndexedChild (const boost::property_tree::ptree &pt, const std::string &path) |
Returns a reference to the subptree in the given ptree, taking indexes of array-elements (of PTreeUtils::Flatten function) into account. More... | |
static void | PutIndexedChild (boost::property_tree::ptree &pt, const std::string &path, const boost::property_tree::ptree &child) |
Put the child in the given ptree on the given path. More... | |
static void | RemoveNonExistingChildren (const boost::property_tree::ptree &src, boost::property_tree::ptree &dst, const std::set< std::string > &ignore=std::set< std::string >()) |
Removes every node in 'destination' ptree if that node doesn't exist in 'source' ptree. More... | |
A collection of functions for manipulating the structure of ptrees.
Definition at line 35 of file PTreeUtils.h.
|
static |
Copies every node from 'source' ptree if that node doesn't exist in 'destination' ptree.
src | 'source' ptree. |
dst | 'destination' ptree. |
ignore | A list of node keys not to copy. (they are skipped). |
Definition at line 68 of file PTreeUtils.cpp.
|
static |
Fill the first ptree with the second ptree.
The ptrees should have the same structures.
pt1 | The first ptree. |
pt2 | The second ptree. |
Definition at line 111 of file PTreeUtils.cpp.
Referenced by SimPT_Editor::EditControlLogic::CopyAttributes().
|
static |
Flattens a ptree from a given path.
pt | The given ptree. |
indexedArray | Whether to append indexes '[i]' to children of '*_array' entries of the ptree. |
path | The given path (shouldn't be given when the full ptree should be flatten). |
Definition at line 130 of file PTreeUtils.cpp.
Referenced by SimPT_Parex::ParameterExploration::GetPossibleParameters().
|
static |
Returns a reference to the subptree in the given ptree, taking indexes of array-elements (of PTreeUtils::Flatten function) into account.
pt | The given ptree. |
path | The given path. |
Definition at line 152 of file PTreeUtils.cpp.
Referenced by SimPT_Parex::ParameterExploration::GetOriginalValue().
|
static |
Put the child in the given ptree on the given path.
The path can contain indexes. The path can't be empty and when a node doesn't exist, it will only be created when it has no index or when the index is zero.
pt | The given ptree. |
path | The given path. |
child | The given child. |
Definition at line 193 of file PTreeUtils.cpp.
Referenced by SimPT_Parex::ParameterExploration::CreateTask().
|
static |
Removes every node in 'destination' ptree if that node doesn't exist in 'source' ptree.
src | 'source' ptree. |
dst | 'destination' ptree. |
ignore | A list of node keys not to remove. (they are skipped). |
Definition at line 235 of file PTreeUtils.cpp.