| 172 | } |
| 173 | |
| 174 | static PyObject* vtkRead(PyObject* self, PyObject* args) |
| 175 | { |
| 176 | (void)args; |
| 177 | if (!self || !PyObject_TypeCheck(self, &vtkPythonStdStreamCaptureHelperType)) |
| 178 | { |
| 179 | return nullptr; |
| 180 | } |
| 181 | |
| 182 | vtkPythonStdStreamCaptureHelper* wrapper = |
| 183 | reinterpret_cast<vtkPythonStdStreamCaptureHelper*>(self); |
| 184 | |
| 185 | std::string ret; |
| 186 | if (wrapper) |
| 187 | { |
| 188 | ret = wrapper->Read(); |
| 189 | } |
| 190 | return Py_BuildValue("s", ret.c_str()); |
| 191 | } |
| 192 | |
| 193 | static PyObject* vtkFlush(PyObject* self, PyObject* args) |
| 194 | { |