summaryrefslogtreecommitdiffstats
path: root/cython/plist.pxd
blob: 99dcca5003482fc705f28730c1d36825ce7d50a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from libc.stdint cimport *

cdef extern from "plist/plist.h":
    ctypedef void *plist_t
    ctypedef void *plist_dict_iter
    void plist_free(plist_t node)

cdef class Node:
    cdef plist_t _c_node
    cdef bint _c_managed
    cpdef object __deepcopy__(self, memo=*)
    cpdef unicode to_xml(self)
    cpdef bytes to_bin(self)
    cpdef object copy(self)

cdef class Bool(Node):
    cpdef set_value(self, object value)
    cpdef bint get_value(self)

cdef class Integer(Node):
    cpdef set_value(self, object value)
    cpdef uint64_t get_value(self)

cdef class Uid(Node):
    cpdef set_value(self, object value)
    cpdef uint64_t get_value(self)

cdef class Key(Node):
    cpdef set_value(self, object value)
    cpdef unicode get_value(self)

cdef class Real(Node):
    cpdef set_value(self, object value)
    cpdef float get_value(self)

cdef class String(Node):
    cpdef set_value(self, object value)
    cpdef unicode get_value(self)

cdef class Date(Node):
    cpdef set_value(self, object value)
    cpdef object get_value(self)

cdef class Data(Node):
    cpdef set_value(self, object 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 bint 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, object item)

cpdef object from_xml(xml)
cpdef object from_bin(bytes bin)

cpdef object load(fp, fmt=*, use_builtin_types=*, dict_type=*)
cpdef object loads(data, fmt=*, use_builtin_types=*, dict_type=*)

cdef object plist_t_to_node(plist_t c_plist, bint managed=*)
cdef plist_t native_to_plist_t(object native)