return convertVecPairVecStToPy(ret);
}
- //void changePflsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
- //void changeLocsNamesInStruct(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
- //void changePflsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
- //void changeLocsNames(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception);
+ void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changePflsNames(v);
+ }
+
+ void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changePflsRefsNamesGen(v);
+ }
+
+ void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changePflsNamesInStruct(v);
+ }
+
+ void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changeLocsNames(v);
+ }
+
+ void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changeLocsRefsNamesGen(v);
+ }
+
+ void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ std::vector< std::pair<std::vector<std::string>, std::string > > v=convertVecPairVecStFromPy(li);
+ self->changeLocsNamesInStruct(v);
+ }
}
};
}
return ret;
}
+
+std::vector< std::pair<std::vector<std::string>, std::string > > convertVecPairVecStFromPy(PyObject *pyLi)
+{
+ std::vector< std::pair<std::vector<std::string>, std::string > > ret;
+ const char *msg="convertVecPairVecStFromPy : Expecting PyList of Tuples of size 2 ! The first elt in tupe is a list of strings and the 2nd one a string !";
+ if(PyList_Check(pyLi))
+ {
+ int size=PyList_Size(pyLi);
+ ret.resize(size);
+ for(int i=0;i<size;i++)
+ {
+ PyObject *o=PyList_GetItem(pyLi,i);
+ if(PyTuple_Check(o))
+ {
+ std::pair<std::vector<std::string>, std::string> p;
+ int size2=PyTuple_Size(o);
+ if(size2!=2)
+ throw INTERP_KERNEL::Exception(msg);
+ PyObject *o0=PyTuple_GetItem(o,0);
+ if(PyList_Check(o0))
+ {
+ int size2=PyList_Size(o0);
+ p.first.resize(size2);
+ for(int j=0;j<size2;j++)
+ {
+ PyObject *o0j=PyTuple_GetItem(o0,j);
+ if(PyString_Check(o0j))
+ {
+ p.first[j]=std::string(PyString_AsString(o0j));
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg);
+ PyObject *o1=PyTuple_GetItem(o,1);
+ if(PyString_Check(o1))
+ p.second=std::string(PyString_AsString(o1));
+ else
+ throw INTERP_KERNEL::Exception(msg);
+ ret[i]=p;
+ }
+ else
+ throw INTERP_KERNEL::Exception(msg);
+ }
+ return ret;
+ }
+ throw INTERP_KERNEL::Exception(msg);
+}