]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind: Add decode_cstr helper function
authorDavid Coles <dcoles@gaikai.com>
Tue, 27 Oct 2015 20:32:44 +0000 (13:32 -0700)
committerDavid Coles <dcoles@gaikai.com>
Fri, 13 Nov 2015 01:26:34 +0000 (17:26 -0800)
commit0b3435f114b91c473b1ec7d73e8e6dbb4089628f
tree4c4f9c7c380785f2639defb5c1a0031a66857ab5
parent801ea73a691539fd1c9f4ebe006cf8d6eb52c5b1
pybind: Add decode_cstr helper function

This function attempts to decode a C-style string into a Python Unicode string.
It accepts an optional "size" parameter for the string length, otherwise it is
assumed that the string is NUL-terminated.

If the pointer is NULL, then this function returns None.

Signed-off-by: David Coles <dcoles@gaikai.com>
src/pybind/rados.py
src/pybind/rbd.py
src/test/pybind/test_rados.py