From 0f69774fcfe32ac2a8dacefbea61e84d0a26a012 Mon Sep 17 00:00:00 2001 From: Jonathan Beck Date: Fri, 16 Oct 2009 22:32:15 +0200 Subject: Change python binding to be based on libplist++ object model. Deprecate old binding. --- swig/plist.i | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'swig/plist.i') diff --git a/swig/plist.i b/swig/plist.i index dd0121d..1ab35b5 100644 --- a/swig/plist.i +++ b/swig/plist.i @@ -4,6 +4,8 @@ %{ /* Includes the header in the wrapper code */ #include + #include + typedef struct { plist_t node; char should_keep_plist; @@ -21,6 +23,34 @@ PListNode *allocate_plist_wrapper(plist_t plist, char should_keep_plist) { } %} +%include "stl.i" + +%rename(__assign__) *::operator=; +%rename(__getitem__) *::operator[]; + +%ignore Boolean(plist_t); +%ignore Integer(plist_t); +%ignore Real(plist_t); +%ignore String(plist_t); +%ignore Data(plist_t); +%ignore Date(plist_t); +%ignore Array(plist_t); +%ignore Dictionary(plist_t); + +%include +%include +%include +%include +%include +%include +%include +%include +%include +%include +%include + +//deprecated wrapper below + %include "stdint.i" %include "cstring.i" @@ -189,9 +219,9 @@ typedef struct { } char as_bool() { - char b; + uint8_t b; plist_get_bool_val($self->node, &b); - return b; + return (char)b; } uint64_t as_uint() { -- cgit v1.1-32-gdbae