Skip to content
Snippets Groups Projects
Commit a7334494 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #7336: Add a toString() function to pyparameterset, allowing export to a string

parent 5840d266
No related branches found
No related tags found
No related merge requests found
...@@ -87,6 +87,9 @@ namespace LOFAR { ...@@ -87,6 +87,9 @@ namespace LOFAR {
void adoptCollection (const PyParameterSet& parset, const string& prefix) void adoptCollection (const PyParameterSet& parset, const string& prefix)
{ return ParameterSet::adoptCollection (parset, prefix); } { return ParameterSet::adoptCollection (parset, prefix); }
string toString() const
{ string buffer; writeBuffer(buffer); return buffer; }
PyParameterValue get (const string& key) const PyParameterValue get (const string& key) const
{ return ParameterSet::get (key); } { return ParameterSet::get (key); }
...@@ -252,6 +255,8 @@ namespace LOFAR { ...@@ -252,6 +255,8 @@ namespace LOFAR {
(boost::python::arg("filename"), (boost::python::arg("filename"),
boost::python::arg("append")=false), boost::python::arg("append")=false),
"Write the parameterset into a parset file with the given name.") "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, .def ("add", fadd,
(boost::python::arg("key"), (boost::python::arg("key"),
boost::python::arg("value")), boost::python::arg("value")),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment