Tizen 2.1 base
[external/libzypp-bindings.git] / swig / perl5 / perl.i
1
2 %ignore zypp::Arch_empty;
3
4 namespace zypp
5 {
6     // These operators must be ignored otherwise the wrapper does
7     // not compile (using swig 1.3.29).
8     %ignore operator<<;
9     %ignore operator==;
10     %ignore operator!=;
11
12     namespace filesystem
13     {
14         // Same as above.
15         %ignore operator==;
16         %ignore operator!=;
17         %ignore operator<<;
18     }
19 }
20
21 %define iter(cls, storetype)
22 %extend cls {
23    cls::const_iterator iterator_incr(cls::const_iterator *it){
24       (*it)++;
25       return *it;
26    }
27    cls::const_iterator iterator_decr(cls::const_iterator *it){
28       (*it)--;
29       return *it;
30    }
31    bool iterator_equal(cls::const_iterator it1, cls::const_iterator it2) {
32       return (it1 == it2);
33    }
34    storetype iterator_value(cls::const_iterator it) {
35       return (&**it);
36    }
37    cls::const_iterator cBegin() {
38       return self->begin();
39    }
40    cls::const_iterator cEnd() {
41       return self->end();
42    }
43 };
44 %enddef
45
46 %define iter2(cls, storetype)
47 %extend cls {
48    cls::const_iterator iterator_incr(cls::const_iterator *it){
49       ++(*it);
50       return *it;
51    }
52    cls::const_iterator iterator_decr(cls::const_iterator *it){
53       --(*it);
54       return *it;
55    }
56    bool iterator_equal(cls::const_iterator it1, cls::const_iterator it2) {
57       return (it1 == it2);
58    }
59    storetype iterator_value(cls::const_iterator it) {
60       return (*it);
61    }
62    cls::const_iterator cBegin() {
63       return self->begin();
64    }
65    cls::const_iterator cEnd() {
66       return self->end();
67    }
68 };
69 %enddef
70
71 // no operator--
72 %define forwarditer(cls, storetype)
73 %extend cls {
74    cls::const_iterator iterator_incr(cls::const_iterator *it){
75       ++(*it);
76       return *it;
77    }
78    bool iterator_equal(cls::const_iterator it1, cls::const_iterator it2) {
79       return (it1 == it2);
80    }
81    storetype iterator_value(cls::const_iterator it) {
82       return (*it);
83    }
84    cls::const_iterator cBegin() {
85       return self->begin();
86    }
87    cls::const_iterator cEnd() {
88       return self->end();
89    }
90 };
91 %enddef