Base: expose a method to rename a parameter group to Python
This commit is contained in:
@@ -117,6 +117,7 @@ public:
|
||||
Py::Object getGroups(const Py::Tuple&);
|
||||
Py::Object remGroup(const Py::Tuple&);
|
||||
Py::Object hasGroup(const Py::Tuple&);
|
||||
Py::Object renameGroup(const Py::Tuple&);
|
||||
|
||||
Py::Object getManager(const Py::Tuple&);
|
||||
Py::Object getParent(const Py::Tuple&);
|
||||
@@ -191,6 +192,7 @@ void ParameterGrpPy::init_type()
|
||||
add_varargs_method("GetGroups", &ParameterGrpPy::getGroups, "GetGroups()");
|
||||
add_varargs_method("RemGroup", &ParameterGrpPy::remGroup, "RemGroup(str)");
|
||||
add_varargs_method("HasGroup", &ParameterGrpPy::hasGroup, "HasGroup(str)");
|
||||
add_varargs_method("RenameGroup", &ParameterGrpPy::renameGroup, "RenameGroup(str, str)");
|
||||
|
||||
add_varargs_method("Manager", &ParameterGrpPy::getManager, "Manager()");
|
||||
add_varargs_method("Parent", &ParameterGrpPy::getParent, "Parent()");
|
||||
@@ -689,6 +691,17 @@ Py::Object ParameterGrpPy::hasGroup(const Py::Tuple& args)
|
||||
return Py::Boolean(_cParamGrp->HasGroup(pstr)); // NOLINT
|
||||
}
|
||||
|
||||
Py::Object ParameterGrpPy::renameGroup(const Py::Tuple& args)
|
||||
{
|
||||
char* oldname = nullptr;
|
||||
char* newname = nullptr;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "ss", &oldname, &newname)) {
|
||||
throw Py::Exception();
|
||||
}
|
||||
|
||||
return Py::Boolean(_cParamGrp->RenameGrp(oldname, newname)); // NOLINT
|
||||
}
|
||||
|
||||
Py::Object ParameterGrpPy::attach(const Py::Tuple& args)
|
||||
{
|
||||
PyObject* obj = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user