diff options
author | Bryan Forbes | 2011-09-26 17:14:39 +0200 |
---|---|---|
committer | Nikias Bassen | 2011-09-26 17:14:39 +0200 |
commit | 2ca52d65bb113e8639e732f67fec3c3223c0a444 (patch) | |
tree | b937e0c7a6a93eca914c0571bd71c85a3f2408b4 /cython/plist.pxd | |
parent | 36ad4384303e94b19cdf7a5ff43182efebe1b398 (diff) | |
download | libplist-2ca52d65bb113e8639e732f67fec3c3223c0a444.tar.gz libplist-2ca52d65bb113e8639e732f67fec3c3223c0a444.tar.bz2 |
Added cython bindings.
Diffstat (limited to 'cython/plist.pxd')
-rw-r--r-- | cython/plist.pxd | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/cython/plist.pxd b/cython/plist.pxd new file mode 100644 index 0000000..daafd78 --- /dev/null +++ b/cython/plist.pxd @@ -0,0 +1,62 @@ +cdef extern from "plist/plist.h": + ctypedef void *plist_t + ctypedef void *plist_dict_iter + +cdef class Node: + cdef plist_t _c_node + cdef bool _c_managed + cpdef object __deepcopy__(self, memo=*) + cpdef bytes to_xml(self) + cpdef bytes to_bin(self) + cpdef object copy(self) + +cdef class Bool(Node): + cpdef set_value(self, value) + cpdef bool get_value(self) + +cdef class Integer(Node): + cpdef set_value(self, value) + cpdef int get_value(self) + +cdef class Real(Node): + cpdef set_value(self, value) + cpdef float get_value(self) + +cdef class String(Node): + cpdef set_value(self, unicode value) + cpdef unicode get_value(self) + +cdef class Date(Node): + cpdef set_value(self, value) + cpdef object get_value(self) + +cdef class Data(Node): + cpdef set_value(self, bytes value) + cpdef bytes get_value(self) + +cdef class Dict(Node): + cdef dict _map + cdef void _init(self) + cpdef set_value(self, dict value) + cpdef dict get_value(self) + cpdef bool has_key(self, key) + cpdef object get(self, key, default=*) + cpdef list keys(self) + cpdef list items(self) + cpdef list values(self) + cpdef object iterkeys(self) + cpdef object iteritems(self) + cpdef object itervalues(self) + +cdef class Array(Node): + cdef list _array + cdef void _init(self) + cpdef set_value(self, value) + cpdef list get_value(self) + cpdef append(self, item) + +cpdef object from_xml(xml) +cpdef object from_bin(bytes bin) + +cdef object plist_t_to_node(plist_t c_plist, bool managed=*) +cdef plist_t native_to_plist_t(object native) |