commit 93dfbb7aeaae7a15897a77854f5af1f9e4262d47 Author: Martin Szulecki Date: Wed Apr 15 16:33:40 2009 +0200 Add from_xml, from_bin, find_node_by_key and rename AddSubNode in Python API 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 { free($self); } - void AddSubNode(PListNode* subnode) { + void add_sub_node(PListNode* subnode) { plist_add_sub_node($self->node, subnode); } @@ -153,7 +153,13 @@ typedef struct { return plist_get_node_type($self->node); } - PListNode* find_sub_node_by_string(char* s) { + PListNode* find_node_by_key(char *s) { + PListNode* plist = (PListNode*) malloc(sizeof(PListNode)); + plist = plist_find_node_by_key($self->node, s); + return plist; + } + + PListNode* find_node_by_string(char* s) { PListNode* plist = (PListNode*) malloc(sizeof(PListNode)); plist = plist_find_node_by_string($self->node, s); return plist; @@ -172,5 +178,13 @@ typedef struct { plist_to_bin($self->node, &s, &l); return s; } + + void from_xml (char* xml) { + plist_from_xml(xml, strlen(xml), &$self->node); + } + + void from_bin (char* data, uint64_t len) { + plist_from_bin(data, len, &$self->node); + } };