summaryrefslogtreecommitdiffstats
path: root/swig/plist.i
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-04-15 16:33:40 +0200
committerGravatar Jonathan Beck2009-04-15 18:25:53 +0200
commite60af04e9fdb3a825454b615fdd61a22324af2fd (patch)
tree54a63573601eeb27eae1e445b2b7549ef35fe335 /swig/plist.i
parent460f5b42af82f4f4232f605b3d4f71abcbbd5d4b (diff)
downloadlibplist-e60af04e9fdb3a825454b615fdd61a22324af2fd.tar.gz
libplist-e60af04e9fdb3a825454b615fdd61a22324af2fd.tar.bz2
Add from_xml, from_bin, find_node_by_key and rename AddSubNode in Python API
Diffstat (limited to 'swig/plist.i')
-rw-r--r--swig/plist.i18
1 files changed, 16 insertions, 2 deletions
diff --git a/swig/plist.i b/swig/plist.i
index c750cd7..055039b 100644
--- a/swig/plist.i
+++ b/swig/plist.i
@@ -66,7 +66,7 @@ typedef struct {
66 free($self); 66 free($self);
67 } 67 }
68 68
69 void AddSubNode(PListNode* subnode) { 69 void add_sub_node(PListNode* subnode) {
70 plist_add_sub_node($self->node, subnode); 70 plist_add_sub_node($self->node, subnode);
71 } 71 }
72 72
@@ -153,7 +153,13 @@ typedef struct {
153 return plist_get_node_type($self->node); 153 return plist_get_node_type($self->node);
154 } 154 }
155 155
156 PListNode* find_sub_node_by_string(char* s) { 156 PListNode* find_node_by_key(char *s) {
157 PListNode* plist = (PListNode*) malloc(sizeof(PListNode));
158 plist = plist_find_node_by_key($self->node, s);
159 return plist;
160 }
161
162 PListNode* find_node_by_string(char* s) {
157 PListNode* plist = (PListNode*) malloc(sizeof(PListNode)); 163 PListNode* plist = (PListNode*) malloc(sizeof(PListNode));
158 plist = plist_find_node_by_string($self->node, s); 164 plist = plist_find_node_by_string($self->node, s);
159 return plist; 165 return plist;
@@ -172,5 +178,13 @@ typedef struct {
172 plist_to_bin($self->node, &s, &l); 178 plist_to_bin($self->node, &s, &l);
173 return s; 179 return s;
174 } 180 }
181
182 void from_xml (char* xml) {
183 plist_from_xml(xml, strlen(xml), &$self->node);
184 }
185
186 void from_bin (char* data, uint64_t len) {
187 plist_from_bin(data, len, &$self->node);
188 }
175}; 189};
176 190