diff options
| author | 2009-10-16 22:32:15 +0200 | |
|---|---|---|
| committer | 2009-10-16 22:32:15 +0200 | |
| commit | 0f69774fcfe32ac2a8dacefbea61e84d0a26a012 (patch) | |
| tree | 5da7e0d661b9126e5bd0f98d592a5665a36461e0 /swig/plist.i | |
| parent | 7ba9a5437e49868ca7a7cc2f4d006509308b1ab4 (diff) | |
| download | libplist-0f69774fcfe32ac2a8dacefbea61e84d0a26a012.tar.gz libplist-0f69774fcfe32ac2a8dacefbea61e84d0a26a012.tar.bz2 | |
Change python binding to be based on libplist++ object model.
Deprecate old binding.
Diffstat (limited to 'swig/plist.i')
| -rw-r--r-- | swig/plist.i | 34 |
1 files changed, 32 insertions, 2 deletions
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 @@ | |||
| 4 | %{ | 4 | %{ |
| 5 | /* Includes the header in the wrapper code */ | 5 | /* Includes the header in the wrapper code */ |
| 6 | #include <plist/plist.h> | 6 | #include <plist/plist.h> |
| 7 | #include <plist/plist++.h> | ||
| 8 | |||
| 7 | typedef struct { | 9 | typedef struct { |
| 8 | plist_t node; | 10 | plist_t node; |
| 9 | char should_keep_plist; | 11 | char should_keep_plist; |
| @@ -21,6 +23,34 @@ PListNode *allocate_plist_wrapper(plist_t plist, char should_keep_plist) { | |||
| 21 | } | 23 | } |
| 22 | %} | 24 | %} |
| 23 | 25 | ||
| 26 | %include "stl.i" | ||
| 27 | |||
| 28 | %rename(__assign__) *::operator=; | ||
| 29 | %rename(__getitem__) *::operator[]; | ||
| 30 | |||
| 31 | %ignore Boolean(plist_t); | ||
| 32 | %ignore Integer(plist_t); | ||
| 33 | %ignore Real(plist_t); | ||
| 34 | %ignore String(plist_t); | ||
| 35 | %ignore Data(plist_t); | ||
| 36 | %ignore Date(plist_t); | ||
| 37 | %ignore Array(plist_t); | ||
| 38 | %ignore Dictionary(plist_t); | ||
| 39 | |||
| 40 | %include <plist/Node.h> | ||
| 41 | %include <plist/Boolean.h> | ||
| 42 | %include <plist/Integer.h> | ||
| 43 | %include <plist/Real.h> | ||
| 44 | %include <plist/String.h> | ||
| 45 | %include <plist/Data.h> | ||
| 46 | %include <plist/Date.h> | ||
| 47 | %include <plist/Structure.h> | ||
| 48 | %include <plist/Array.h> | ||
| 49 | %include <plist/Dictionary.h> | ||
| 50 | %include <plist/Utils.h> | ||
| 51 | |||
| 52 | //deprecated wrapper below | ||
| 53 | |||
| 24 | %include "stdint.i" | 54 | %include "stdint.i" |
| 25 | %include "cstring.i" | 55 | %include "cstring.i" |
| 26 | 56 | ||
| @@ -189,9 +219,9 @@ typedef struct { | |||
| 189 | } | 219 | } |
| 190 | 220 | ||
| 191 | char as_bool() { | 221 | char as_bool() { |
| 192 | char b; | 222 | uint8_t b; |
| 193 | plist_get_bool_val($self->node, &b); | 223 | plist_get_bool_val($self->node, &b); |
| 194 | return b; | 224 | return (char)b; |
| 195 | } | 225 | } |
| 196 | 226 | ||
| 197 | uint64_t as_uint() { | 227 | uint64_t as_uint() { |
