| 309 | } |
| 310 | |
| 311 | PyObject* ComplexGeoDataPy::getElementName(PyObject* args) const |
| 312 | { |
| 313 | char* input; |
| 314 | int direction = 0; |
| 315 | if (!PyArg_ParseTuple(args, "s|i", &input, &direction)) { |
| 316 | return NULL; |
| 317 | } |
| 318 | |
| 319 | Data::MappedElement res = getComplexGeoDataPtr()->getElementName(input); |
| 320 | std::string s; |
| 321 | if (direction == 1) { |
| 322 | return Py::new_reference_to(Py::String(res.name.appendToBuffer(s))); |
| 323 | } |
| 324 | else if (direction == 0) { |
| 325 | return Py::new_reference_to(Py::String(res.index.appendToStringBuffer(s))); |
| 326 | } |
| 327 | else if (Data::IndexedName(input)) { |
| 328 | return Py::new_reference_to(Py::String(res.name.appendToBuffer(s))); |
| 329 | } |
| 330 | else { |
| 331 | return Py::new_reference_to(Py::String(res.index.appendToStringBuffer(s))); |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | PyObject* ComplexGeoDataPy::getElementIndexedName(PyObject* args) const |
| 336 | { |
no test coverage detected