1 #ifndef PTREEUTILS_H_INCLUDED
2 #define PTREEUTILS_H_INCLUDED
22 #include <boost/property_tree/ptree_fwd.hpp>
46 const boost::property_tree::ptree& src,
47 boost::property_tree::ptree& dst,
48 const std::set<std::string>& ignore = std::set<std::string>());
50 static void CopyStructure(
51 const boost::property_tree::ptree& src,
52 boost::property_tree::ptree& dst,
53 const std::string& fill_value,
54 const std::set<std::string>& ignore = std::set<std::string>());
64 const boost::property_tree::ptree& src,
65 boost::property_tree::ptree& dst,
66 const std::set<std::string>& ignore = std::set<std::string>());
75 static void FillPTree(boost::property_tree::ptree& pt1,
const boost::property_tree::ptree& pt2);
85 static std::list<std::pair<std::string, std::string>>
86 Flatten(
const boost::property_tree::ptree& pt,
bool indexedArray =
false,
const std::string& path =
"");
96 static const boost::property_tree::ptree&
97 GetIndexedChild(
const boost::property_tree::ptree& pt,
const std::string& path);
109 boost::property_tree::ptree& pt,
110 const std::string& path,
111 const boost::property_tree::ptree& child);
117 #endif // include-guard
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 PTreeUti...
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.
static void FillPTree(boost::property_tree::ptree &pt1, const boost::property_tree::ptree &pt2)
Fill the first ptree with the second ptree.
A collection of functions for manipulating the structure of ptrees.
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.
Namespace for the core simulator.
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.
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...