From a73344942cf82b743ceade088fb40207f7c84352 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Fri, 6 Feb 2015 15:54:31 +0000 Subject: [PATCH] Task #7336: Add a toString() function to pyparameterset, allowing export to a string --- LCS/pyparameterset/src/pyparameterset.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LCS/pyparameterset/src/pyparameterset.cc b/LCS/pyparameterset/src/pyparameterset.cc index 20aad23021b..3a2192c0435 100644 --- a/LCS/pyparameterset/src/pyparameterset.cc +++ b/LCS/pyparameterset/src/pyparameterset.cc @@ -87,6 +87,9 @@ namespace LOFAR { void adoptCollection (const PyParameterSet& parset, const string& prefix) { return ParameterSet::adoptCollection (parset, prefix); } + string toString() const + { string buffer; writeBuffer(buffer); return buffer; } + PyParameterValue get (const string& key) const { return ParameterSet::get (key); } @@ -252,6 +255,8 @@ namespace LOFAR { (boost::python::arg("filename"), boost::python::arg("append")=false), "Write the parameterset into a parset file with the given name.") + .def ("toString", &PyParameterSet::toString, + "Return the full parset as a string") .def ("add", fadd, (boost::python::arg("key"), boost::python::arg("value")), -- GitLab