summaryrefslogtreecommitdiffstats
path: root/swig
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
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')
-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 {
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);
+ }
};