diff options
Diffstat (limited to 'sources/shiboken2/libshiboken/shibokenbuffer.h')
-rw-r--r-- | sources/shiboken2/libshiboken/shibokenbuffer.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/shibokenbuffer.h b/sources/shiboken2/libshiboken/shibokenbuffer.h index dc9f8d89f..512d9db4d 100644 --- a/sources/shiboken2/libshiboken/shibokenbuffer.h +++ b/sources/shiboken2/libshiboken/shibokenbuffer.h @@ -79,6 +79,14 @@ namespace Buffer */ LIBSHIBOKEN_API void *getPointer(PyObject *pyObj, Py_ssize_t *size = nullptr); + /** + * Returns a copy of the buffer data which should be free'd. + * + * If the \p pyObj is a non-contiguous buffer a Python error is set. + * nullptr is returned for empty buffers. + */ + LIBSHIBOKEN_API void *copyData(PyObject *pyObj, Py_ssize_t *size = nullptr); + } // namespace Buffer } // namespace Shiboken |