Fix build with xapian-core < 1.4.10
[xapian.git] / search-xapian / XS / Document.xs
blob1a15e1e1ad66c94a1a2d9bb371d59d87a87f9372
1 MODULE = Search::Xapian                 PACKAGE = Search::Xapian::Document
3 PROTOTYPES: ENABLE
5 Document *
6 new1()
7     CODE:
8         RETVAL = new Document();
9     OUTPUT:
10         RETVAL
12 Document *
13 new2(other)
14     Document * other
15     CODE:
16         RETVAL = new Document(*other);
17     OUTPUT:
18         RETVAL
20 string
21 Document::get_value(valueno valno)
22     CODE:
23         try {
24             RETVAL = THIS->get_value(valno);
25         } catch (...) {
26             handle_exception();
27         }
28     OUTPUT:
29         RETVAL
31 void
32 Document::add_value(valno, value)
33     valueno     valno
34     string      value
35     CODE:
36         try {
37             THIS->add_value(valno, value);
38         } catch (...) {
39             handle_exception();
40         }
42 void
43 Document::remove_value(valueno valno)
44     CODE:
45         try {
46             THIS->remove_value(valno);
47         } catch (...) {
48             handle_exception();
49         }
51 void
52 Document::clear_values()
54 string
55 Document::get_data()
56     CODE:
57         try {
58             RETVAL = THIS->get_data();
59         } catch (...) {
60             handle_exception();
61         }
62     OUTPUT:
63         RETVAL
65 void
66 Document::set_data(data)
67     string      data
68     CODE:
69         THIS->set_data(data);
71 void
72 Document::add_posting(tname, tpos, wdfinc = NO_INIT)
73     string      tname
74     termpos     tpos
75     termcount   wdfinc
76     CODE:
77         try {
78             if (items == 4) { /* items includes the hidden this pointer */
79                 THIS->add_posting(tname, tpos, wdfinc);
80             } else {
81                 THIS->add_posting(tname, tpos);
82             }
83         } catch (...) {
84             handle_exception();
85         }
87 void
88 Document::add_term(tname, wdfinc = NO_INIT)
89     string      tname
90     termcount   wdfinc
91     CODE:
92         try {
93             if (items == 3) { /* items includes the hidden this pointer */
94                 THIS->add_term(tname, wdfinc);
95             } else {
96                 THIS->add_term(tname);
97             }
98         } catch (...) {
99             handle_exception();
100         }
102 void
103 Document::add_boolean_term(tname)
104     string      tname
105     CODE:
106         try {
107             THIS->add_boolean_term(tname);
108         } catch (...) {
109             handle_exception();
110         }
112 void
113 Document::remove_posting(tname, tpos, wdfdec = NO_INIT)
114     string      tname
115     termpos     tpos
116     termcount   wdfdec
117     CODE:
118         try {
119             if (items == 4) { /* items includes the hidden this pointer */
120                 THIS->remove_posting(tname, tpos, wdfdec);
121             } else {
122                 THIS->remove_posting(tname, tpos);
123             }
124         } catch (...) {
125             handle_exception();
126         }
128 void
129 Document::remove_term(tname)
130     string      tname
131     CODE:
132         try {
133             THIS->remove_term(tname);
134         } catch (...) {
135             handle_exception();
136         }
138 void
139 Document::clear_terms()
141 termcount
142 Document::termlist_count()
143     CODE:
144         try {
145             RETVAL = THIS->termlist_count();
146         } catch (...) {
147             handle_exception();
148         }
149     OUTPUT:
150         RETVAL
152 TermIterator *
153 Document::termlist_begin()
154     CODE:
155         try {
156             RETVAL = new TermIterator(THIS->termlist_begin());
157         } catch (...) {
158             handle_exception();
159         }
160     OUTPUT:
161         RETVAL
163 TermIterator *
164 Document::termlist_end()
165     CODE:
166         RETVAL = new TermIterator(THIS->termlist_end());
167     OUTPUT:
168         RETVAL
170 termcount
171 Document::values_count()
172     CODE:
173         try {
174             RETVAL = THIS->values_count();
175         } catch (...) {
176             handle_exception();
177         }
178     OUTPUT:
179         RETVAL
181 ValueIterator *
182 Document::values_begin()
183     CODE:
184         try {
185             RETVAL = new ValueIterator(THIS->values_begin());
186         } catch (...) {
187             handle_exception();
188         }
189     OUTPUT:
190         RETVAL
192 ValueIterator *
193 Document::values_end()
194     CODE:
195         RETVAL = new ValueIterator(THIS->values_end());
196     OUTPUT:
197         RETVAL
199 docid
200 Document::get_docid()
201     CODE:
202         try {
203             RETVAL = THIS->get_docid();
204         } catch (...) {
205             handle_exception();
206         }
207     OUTPUT:
208         RETVAL
210 string
211 Document::get_description()
213 void
214 Document::DESTROY()