comparison python/python-libpst.cpp @ 196:ffd1503a7530

build proper python rpm subpackage
author Carl Byington <carl@five-ten-sg.com>
date Wed, 22 Apr 2009 13:52:18 -0700
parents 320cfcba8058
children 7c60d6d1c681
comparison
equal deleted inserted replaced
195:320cfcba8058 196:ffd1503a7530
2 #include "config.h" 2 #include "config.h"
3 #endif 3 #endif
4 4
5 #include <iostream> 5 #include <iostream>
6 #include <boost/python.hpp> 6 #include <boost/python.hpp>
7 #include <iostream> 7 // #include <boost/python/docstring_options.hpp>
8 // #include <iostream>
8 9
9 extern "C" { 10 extern "C" {
10 #include "libpst.h" 11 #include "libpst.h"
11 #include "timeconv.h" 12 #include "timeconv.h"
12 #include "libstrfunc.h" 13 #include "libstrfunc.h"
44 string pst_rfc2445_datetime_format(const FILETIME *ft); 45 string pst_rfc2445_datetime_format(const FILETIME *ft);
45 string pst_default_charset(pst_item *item); 46 string pst_default_charset(pst_item *item);
46 void pst_convert_utf8_null(pst_item *item, pst_string *str); 47 void pst_convert_utf8_null(pst_item *item, pst_string *str);
47 void pst_convert_utf8(pst_item *item, pst_string *str); 48 void pst_convert_utf8(pst_item *item, pst_string *str);
48 49
50 /** helper for python access to fopen() */
51 FILE* ppst_open_file(string filename, string mode);
52 /** helper for python access to fclose() */
53 int ppst_close_file(FILE* fp);
54
49 private: 55 private:
50 bool is_open; 56 bool is_open;
51 pst_file pf; 57 pst_file pf;
52 pst_item* root; 58 pst_item* root;
53 pst_desc_tree* topf; 59 pst_desc_tree* topf;
141 147
142 void pst::pst_convert_utf8(pst_item *item, pst_string *str) { 148 void pst::pst_convert_utf8(pst_item *item, pst_string *str) {
143 ::pst_convert_utf8(item, str); 149 ::pst_convert_utf8(item, str);
144 } 150 }
145 151
152 FILE* pst::ppst_open_file(string filename, string mode) {
153 return ::fopen(filename.c_str(), mode.c_str());
154 }
155
156 int pst::ppst_close_file(FILE* fp) {
157 return ::fclose(fp);
158 }
159
146 struct make_python_string { 160 struct make_python_string {
147 /* we make no distinction between empty and null strings */ 161 /* we make no distinction between empty and null strings */
148 static PyObject* convert(char* const &s) { 162 static PyObject* convert(char* const &s) {
149 string ss; 163 string ss;
150 if (s) ss = string(s); 164 if (s) ss = string(s);
201 if (s) return to_python_indirect<pst_index_ll*, detail::make_reference_holder>()(s); 215 if (s) return to_python_indirect<pst_index_ll*, detail::make_reference_holder>()(s);
202 return NULL; 216 return NULL;
203 } 217 }
204 }; 218 };
205 219
220 struct make_python_FILE {
221 static PyObject* convert(FILE* const &s) {
222 if (s) return to_python_indirect<FILE*, detail::make_reference_holder>()(s);
223 return NULL;
224 }
225 };
226
206 BOOST_PYTHON_MODULE(_libpst) 227 BOOST_PYTHON_MODULE(_libpst)
207 { 228 {
229 //boost::python::docstring_options doc_options();
230
208 to_python_converter<pst_binary, make_python_pst_binary>(); 231 to_python_converter<pst_binary, make_python_pst_binary>();
209 to_python_converter<ppst_binary, make_python_ppst_binary>(); 232 to_python_converter<ppst_binary, make_python_ppst_binary>();
210 to_python_converter<char*, make_python_string>(); 233 to_python_converter<char*, make_python_string>();
211 to_python_converter<pst_item_email*, make_python_pst_item_email>(); 234 to_python_converter<pst_item_email*, make_python_pst_item_email>();
212 to_python_converter<pst_item_attach*, make_python_pst_item_attach>(); 235 to_python_converter<pst_item_attach*, make_python_pst_item_attach>();
213 to_python_converter<pst_desc_tree*, make_python_pst_desc_tree>(); 236 to_python_converter<pst_desc_tree*, make_python_pst_desc_tree>();
214 to_python_converter<pst_index_ll*, make_python_pst_index_ll>(); 237 to_python_converter<pst_index_ll*, make_python_pst_index_ll>();
238 to_python_converter<FILE*, make_python_FILE>();
239
240 class_<FILE>("FILE")
241 ;
215 242
216 class_<FILETIME>("FILETIME") 243 class_<FILETIME>("FILETIME")
217 .def_readonly("dwLowDateTime", &FILETIME::dwLowDateTime) 244 .def_readwrite("dwLowDateTime", &FILETIME::dwLowDateTime)
218 .def_readonly("dwHighDateTime", &FILETIME::dwHighDateTime) 245 .def_readwrite("dwHighDateTime", &FILETIME::dwHighDateTime)
219 ; 246 ;
220 247
221 class_<pst_entryid>("pst_entryid") 248 class_<pst_entryid>("pst_entryid")
222 .def_readonly("u1", &pst_entryid::u1) 249 .def_readonly("u1", &pst_entryid::u1)
223 .def_readonly("entryid", &pst_entryid::entryid) 250 .def_readonly("entryid", &pst_entryid::entryid)
256 .def_readonly("is_utf8", &pst_string::is_utf8) 283 .def_readonly("is_utf8", &pst_string::is_utf8)
257 .def_readonly("str", &pst_string::str) 284 .def_readonly("str", &pst_string::str)
258 ; 285 ;
259 286
260 class_<pst_item_email>("pst_item_email") 287 class_<pst_item_email>("pst_item_email")
261 .add_property("arrival_date", make_getter(&pst_item_email::arrival_date, return_value_policy<reference_existing_object>())) 288 .add_property("arrival_date", make_getter(&pst_item_email::arrival_date, return_value_policy<reference_existing_object>()))
262 .def_readonly("autoforward", &pst_item_email::autoforward) 289 .def_readonly("autoforward", &pst_item_email::autoforward)
263 .def_readonly("cc_address", &pst_item_email::cc_address) 290 .def_readonly("cc_address", &pst_item_email::cc_address)
264 .def_readonly("bcc_address", &pst_item_email::bcc_address) 291 .def_readonly("bcc_address", &pst_item_email::bcc_address)
265 .def_readonly("conversation_index", &pst_item_email::conversation_index) 292 .def_readonly("conversation_index", &pst_item_email::conversation_index)
266 .def_readonly("conversion_prohibited", &pst_item_email::conversion_prohibited) 293 .def_readonly("conversion_prohibited", &pst_item_email::conversion_prohibited)
267 .def_readonly("delete_after_submit", &pst_item_email::delete_after_submit) 294 .def_readonly("delete_after_submit", &pst_item_email::delete_after_submit)
268 .def_readonly("delivery_report", &pst_item_email::delivery_report) 295 .def_readonly("delivery_report", &pst_item_email::delivery_report)
269 .def_readonly("encrypted_body", &pst_item_email::encrypted_body) 296 .def_readonly("encrypted_body", &pst_item_email::encrypted_body)
270 .def_readonly("encrypted_htmlbody", &pst_item_email::encrypted_htmlbody) 297 .def_readonly("encrypted_htmlbody", &pst_item_email::encrypted_htmlbody)
271 .def_readonly("header", &pst_item_email::header) 298 .def_readonly("header", &pst_item_email::header)
272 .def_readonly("htmlbody", &pst_item_email::htmlbody) 299 .def_readonly("htmlbody", &pst_item_email::htmlbody)
273 .def_readonly("importance", &pst_item_email::importance) 300 .def_readonly("importance", &pst_item_email::importance)
274 .def_readonly("in_reply_to", &pst_item_email::in_reply_to) 301 .def_readonly("in_reply_to", &pst_item_email::in_reply_to)
275 .def_readonly("message_cc_me", &pst_item_email::message_cc_me) 302 .def_readonly("message_cc_me", &pst_item_email::message_cc_me)
276 .def_readonly("message_recip_me", &pst_item_email::message_recip_me) 303 .def_readonly("message_recip_me", &pst_item_email::message_recip_me)
277 .def_readonly("message_to_me", &pst_item_email::message_to_me) 304 .def_readonly("message_to_me", &pst_item_email::message_to_me)
278 .def_readonly("messageid", &pst_item_email::messageid) 305 .def_readonly("messageid", &pst_item_email::messageid)
279 .def_readonly("original_sensitivity", &pst_item_email::original_sensitivity) 306 .def_readonly("original_sensitivity", &pst_item_email::original_sensitivity)
280 .def_readonly("original_bcc", &pst_item_email::original_bcc) 307 .def_readonly("original_bcc", &pst_item_email::original_bcc)
281 .def_readonly("original_cc", &pst_item_email::original_cc) 308 .def_readonly("original_cc", &pst_item_email::original_cc)
282 .def_readonly("original_to", &pst_item_email::original_to) 309 .def_readonly("original_to", &pst_item_email::original_to)
310 .def_readonly("outlook_recipient", &pst_item_email::outlook_recipient)
311 .def_readonly("outlook_recipient_name", &pst_item_email::outlook_recipient_name)
312 .def_readonly("outlook_recipient2", &pst_item_email::outlook_recipient2)
313 .def_readonly("outlook_sender", &pst_item_email::outlook_sender)
314 .def_readonly("outlook_sender_name", &pst_item_email::outlook_sender_name)
315 .def_readonly("outlook_sender2", &pst_item_email::outlook_sender2)
316 .def_readonly("priority", &pst_item_email::priority)
317 .def_readonly("processed_subject", &pst_item_email::processed_subject)
318 .def_readonly("read_receipt", &pst_item_email::read_receipt)
319 .def_readonly("recip_access", &pst_item_email::recip_access)
320 .def_readonly("recip_address", &pst_item_email::recip_address)
321 .def_readonly("recip2_access", &pst_item_email::recip2_access)
322 .def_readonly("recip2_address", &pst_item_email::recip2_address)
323 .def_readonly("reply_requested", &pst_item_email::reply_requested)
324 .def_readonly("reply_to", &pst_item_email::reply_to)
325 .def_readonly("return_path_address", &pst_item_email::return_path_address)
326 .def_readonly("rtf_body_char_count", &pst_item_email::rtf_body_char_count)
327 .def_readonly("rtf_body_crc", &pst_item_email::rtf_body_crc)
328 .def_readonly("rtf_body_tag", &pst_item_email::rtf_body_tag)
329 .def_readonly("rtf_compressed", &pst_item_email::rtf_compressed)
330 .def_readonly("rtf_in_sync", &pst_item_email::rtf_in_sync)
331 .def_readonly("rtf_ws_prefix_count", &pst_item_email::rtf_ws_prefix_count)
332 .def_readonly("rtf_ws_trailing_count", &pst_item_email::rtf_ws_trailing_count)
333 .def_readonly("sender_access", &pst_item_email::sender_access)
334 .def_readonly("sender_address", &pst_item_email::sender_address)
335 .def_readonly("sender2_access", &pst_item_email::sender2_access)
336 .def_readonly("sender2_address", &pst_item_email::sender2_address)
337 .def_readonly("sensitivity", &pst_item_email::sensitivity)
338 .add_property("sent_date", make_getter(&pst_item_email::sent_date, return_value_policy<reference_existing_object>()))
339 .add_property("sentmail_folder", make_getter(&pst_item_email::sentmail_folder, return_value_policy<reference_existing_object>()))
340 .def_readonly("sentto_address", &pst_item_email::sentto_address)
341 .def_readonly("report_text", &pst_item_email::report_text)
342 .add_property("report_time", make_getter(&pst_item_email::report_time, return_value_policy<reference_existing_object>()))
343 .def_readonly("ndr_reason_code", &pst_item_email::ndr_reason_code)
344 .def_readonly("ndr_diag_code", &pst_item_email::ndr_diag_code)
345 .def_readonly("supplementary_info", &pst_item_email::supplementary_info)
346 .def_readonly("ndr_status_code", &pst_item_email::ndr_status_code)
283 ; 347 ;
284 348
285 class_<pst_item_folder>("pst_item_folder") 349 class_<pst_item_folder>("pst_item_folder")
286 .def_readonly("item_count", &pst_item_folder::item_count) 350 .def_readonly("item_count", &pst_item_folder::item_count)
351 .def_readonly("unseen_item_count", &pst_item_folder::unseen_item_count)
352 .def_readonly("assoc_count", &pst_item_folder::assoc_count)
353 .def_readonly("subfolder", &pst_item_folder::subfolder)
287 ; 354 ;
288 355
289 class_<pst_item_message_store>("pst_item_message_store") 356 class_<pst_item_message_store>("pst_item_message_store")
290 .add_property("top_of_personal_folder", make_getter(&pst_item_message_store::top_of_personal_folder, return_value_policy<reference_existing_object>())) 357 .add_property("top_of_personal_folder", make_getter(&pst_item_message_store::top_of_personal_folder, return_value_policy<reference_existing_object>()))
358 .add_property("default_outbox_folder", make_getter(&pst_item_message_store::default_outbox_folder, return_value_policy<reference_existing_object>()))
359 .add_property("deleted_items_folder", make_getter(&pst_item_message_store::deleted_items_folder, return_value_policy<reference_existing_object>()))
360 .add_property("sent_items_folder", make_getter(&pst_item_message_store::sent_items_folder, return_value_policy<reference_existing_object>()))
361 .add_property("user_views_folder", make_getter(&pst_item_message_store::user_views_folder, return_value_policy<reference_existing_object>()))
362 .add_property("common_view_folder", make_getter(&pst_item_message_store::common_view_folder, return_value_policy<reference_existing_object>()))
363 .add_property("search_root_folder", make_getter(&pst_item_message_store::search_root_folder, return_value_policy<reference_existing_object>()))
364 .add_property("top_of_folder", make_getter(&pst_item_message_store::top_of_folder, return_value_policy<reference_existing_object>()))
365 .def_readonly("valid_mask", &pst_item_message_store::valid_mask)
366 .def_readonly("pwd_chksum", &pst_item_message_store::pwd_chksum)
291 ; 367 ;
292 368
293 class_<pst_item_contact>("pst_item_contact") 369 class_<pst_item_contact>("pst_item_contact")
294 .def_readonly("account_name", &pst_item_contact::account_name) 370 .def_readonly("access_method", &pst_item_contact::access_method)
371 .def_readonly("account_name", &pst_item_contact::account_name)
372 .def_readonly("address1", &pst_item_contact::address1)
373 .def_readonly("address1a", &pst_item_contact::address1a)
374 .def_readonly("address1_desc", &pst_item_contact::address1_desc)
375 .def_readonly("address1_transport", &pst_item_contact::address1_transport)
376 .def_readonly("address2", &pst_item_contact::address2)
377 .def_readonly("address2a", &pst_item_contact::address2a)
378 .def_readonly("address2_desc", &pst_item_contact::address2_desc)
379 .def_readonly("address2_transport", &pst_item_contact::address2_transport)
380 .def_readonly("address3", &pst_item_contact::address3)
381 .def_readonly("address3a", &pst_item_contact::address3a)
382 .def_readonly("address3_desc", &pst_item_contact::address3_desc)
383 .def_readonly("address3_transport", &pst_item_contact::address3_transport)
384 .def_readonly("assistant_name", &pst_item_contact::assistant_name)
385 .def_readonly("assistant_phone", &pst_item_contact::assistant_phone)
386 .def_readonly("billing_information", &pst_item_contact::billing_information)
387 .add_property("birthday", make_getter(&pst_item_contact::birthday, return_value_policy<reference_existing_object>()))
388 .def_readonly("business_address", &pst_item_contact::business_address)
389 .def_readonly("business_city", &pst_item_contact::business_city)
390 .def_readonly("business_country", &pst_item_contact::business_country)
391 .def_readonly("business_fax", &pst_item_contact::business_fax)
392 .def_readonly("business_homepage", &pst_item_contact::business_homepage)
393 .def_readonly("business_phone", &pst_item_contact::business_phone)
394 .def_readonly("business_phone2", &pst_item_contact::business_phone2)
395 .def_readonly("business_po_box", &pst_item_contact::business_po_box)
396 .def_readonly("business_postal_code", &pst_item_contact::business_postal_code)
397 .def_readonly("business_state", &pst_item_contact::business_state)
398 .def_readonly("business_street", &pst_item_contact::business_street)
399 .def_readonly("callback_phone", &pst_item_contact::callback_phone)
400 .def_readonly("car_phone", &pst_item_contact::car_phone)
401 .def_readonly("company_main_phone", &pst_item_contact::company_main_phone)
402 .def_readonly("company_name", &pst_item_contact::company_name)
403 .def_readonly("computer_name", &pst_item_contact::computer_name)
404 .def_readonly("customer_id", &pst_item_contact::customer_id)
405 .def_readonly("def_postal_address", &pst_item_contact::def_postal_address)
406 .def_readonly("department", &pst_item_contact::department)
407 .def_readonly("display_name_prefix", &pst_item_contact::display_name_prefix)
408 .def_readonly("first_name", &pst_item_contact::first_name)
409 .def_readonly("followup", &pst_item_contact::followup)
410 .def_readonly("free_busy_address", &pst_item_contact::free_busy_address)
411 .def_readonly("ftp_site", &pst_item_contact::ftp_site)
412 .def_readonly("fullname", &pst_item_contact::fullname)
413 .def_readonly("gender", &pst_item_contact::gender)
414 .def_readonly("gov_id", &pst_item_contact::gov_id)
415 .def_readonly("hobbies", &pst_item_contact::hobbies)
416 .def_readonly("home_address", &pst_item_contact::home_address)
417 .def_readonly("home_city", &pst_item_contact::home_city)
418 .def_readonly("home_country", &pst_item_contact::home_country)
419 .def_readonly("home_fax", &pst_item_contact::home_fax)
420 .def_readonly("home_phone", &pst_item_contact::home_phone)
421 .def_readonly("home_phone2", &pst_item_contact::home_phone2)
422 .def_readonly("home_po_box", &pst_item_contact::home_po_box)
423 .def_readonly("home_postal_code", &pst_item_contact::home_postal_code)
424 .def_readonly("home_state", &pst_item_contact::home_state)
425 .def_readonly("home_street", &pst_item_contact::home_street)
426 .def_readonly("initials", &pst_item_contact::initials)
427 .def_readonly("isdn_phone", &pst_item_contact::isdn_phone)
428 .def_readonly("job_title", &pst_item_contact::job_title)
429 .def_readonly("keyword", &pst_item_contact::keyword)
430 .def_readonly("language", &pst_item_contact::language)
431 .def_readonly("location", &pst_item_contact::location)
432 .def_readonly("mail_permission", &pst_item_contact::mail_permission)
433 .def_readonly("manager_name", &pst_item_contact::manager_name)
434 .def_readonly("middle_name", &pst_item_contact::middle_name)
435 .def_readonly("mileage", &pst_item_contact::mileage)
436 .def_readonly("mobile_phone", &pst_item_contact::mobile_phone)
437 .def_readonly("nickname", &pst_item_contact::nickname)
438 .def_readonly("office_loc", &pst_item_contact::office_loc)
439 .def_readonly("common_name", &pst_item_contact::common_name)
440 .def_readonly("org_id", &pst_item_contact::org_id)
441 .def_readonly("other_address", &pst_item_contact::other_address)
442 .def_readonly("other_city", &pst_item_contact::other_city)
443 .def_readonly("other_country", &pst_item_contact::other_country)
444 .def_readonly("other_phone", &pst_item_contact::other_phone)
445 .def_readonly("other_po_box", &pst_item_contact::other_po_box)
446 .def_readonly("other_postal_code", &pst_item_contact::other_postal_code)
447 .def_readonly("other_state", &pst_item_contact::other_state)
448 .def_readonly("other_street", &pst_item_contact::other_street)
449 .def_readonly("pager_phone", &pst_item_contact::pager_phone)
450 .def_readonly("personal_homepage", &pst_item_contact::personal_homepage)
451 .def_readonly("pref_name", &pst_item_contact::pref_name)
452 .def_readonly("primary_fax", &pst_item_contact::primary_fax)
453 .def_readonly("primary_phone", &pst_item_contact::primary_phone)
454 .def_readonly("profession", &pst_item_contact::profession)
455 .def_readonly("radio_phone", &pst_item_contact::radio_phone)
456 .def_readonly("rich_text", &pst_item_contact::rich_text)
457 .def_readonly("spouse_name", &pst_item_contact::spouse_name)
458 .def_readonly("suffix", &pst_item_contact::suffix)
459 .def_readonly("surname", &pst_item_contact::surname)
460 .def_readonly("telex", &pst_item_contact::telex)
461 .def_readonly("transmittable_display_name", &pst_item_contact::transmittable_display_name)
462 .def_readonly("ttytdd_phone", &pst_item_contact::ttytdd_phone)
463 .add_property("wedding_anniversary", make_getter(&pst_item_contact::wedding_anniversary, return_value_policy<reference_existing_object>()))
464 .def_readonly("work_address_street", &pst_item_contact::work_address_street)
465 .def_readonly("work_address_city", &pst_item_contact::work_address_city)
466 .def_readonly("work_address_state", &pst_item_contact::work_address_state)
467 .def_readonly("work_address_postalcode", &pst_item_contact::work_address_postalcode)
468 .def_readonly("work_address_country", &pst_item_contact::work_address_country)
469 .def_readonly("work_address_postofficebox", &pst_item_contact::work_address_postofficebox)
295 ; 470 ;
296 471
297 class_<pst_item_attach>("pst_item_attach") 472 class_<pst_item_attach>("pst_item_attach")
298 .def_readonly("filename1", &pst_item_attach::filename1) 473 .def_readonly("filename1", &pst_item_attach::filename1)
299 .def_readonly("filename2", &pst_item_attach::filename2) 474 .def_readonly("filename2", &pst_item_attach::filename2)
307 .def_readonly("sequence", &pst_item_attach::sequence) 482 .def_readonly("sequence", &pst_item_attach::sequence)
308 .add_property("next", make_getter(&pst_item_attach::next, return_value_policy<reference_existing_object>())) 483 .add_property("next", make_getter(&pst_item_attach::next, return_value_policy<reference_existing_object>()))
309 ; 484 ;
310 485
311 class_<pst_item_extra_field>("pst_item_extra_field") 486 class_<pst_item_extra_field>("pst_item_extra_field")
312 .def_readonly("field_name", &pst_item_extra_field::field_name) 487 .def_readonly("field_name", &pst_item_extra_field::field_name)
488 .def_readonly("value", &pst_item_extra_field::value)
489 .add_property("next", make_getter(&pst_item_extra_field::next, return_value_policy<reference_existing_object>()))
313 ; 490 ;
314 491
315 class_<pst_item_journal>("pst_item_journal") 492 class_<pst_item_journal>("pst_item_journal")
316 .def_readonly("description", &pst_item_journal::description) 493 .add_property("end", make_getter(&pst_item_journal::end, return_value_policy<reference_existing_object>()))
494 .add_property("start", make_getter(&pst_item_journal::start, return_value_policy<reference_existing_object>()))
495 .def_readonly("type", &pst_item_journal::type)
496 .def_readonly("description", &pst_item_journal::description)
317 ; 497 ;
318 498
319 class_<pst_item_appointment>("pst_item_appointment") 499 class_<pst_item_appointment>("pst_item_appointment")
320 .add_property("end", make_getter(&pst_item_appointment::end, return_value_policy<reference_existing_object>())) 500 .add_property("end", make_getter(&pst_item_appointment::end, return_value_policy<reference_existing_object>()))
321 .def_readonly("label", &pst_item_appointment::label) 501 .def_readonly("location", &pst_item_appointment::location)
502 .add_property("reminder", make_getter(&pst_item_appointment::reminder, return_value_policy<reference_existing_object>()))
503 .def_readonly("alarm_minutes", &pst_item_appointment::alarm_minutes)
504 .def_readonly("alarm_filename", &pst_item_appointment::alarm_filename)
505 .add_property("start", make_getter(&pst_item_appointment::start, return_value_policy<reference_existing_object>()))
506 .def_readonly("timezonestring", &pst_item_appointment::timezonestring)
507 .def_readonly("showas", &pst_item_appointment::showas)
508 .def_readonly("label", &pst_item_appointment::label)
509 .def_readonly("all_day", &pst_item_appointment::all_day)
510 .def_readonly("recurrence", &pst_item_appointment::recurrence)
511 .def_readonly("recurrence_type", &pst_item_appointment::recurrence_type)
512 .add_property("recurrence_start", make_getter(&pst_item_appointment::recurrence_start, return_value_policy<reference_existing_object>()))
513 .add_property("recurrence_end", make_getter(&pst_item_appointment::recurrence_end, return_value_policy<reference_existing_object>()))
322 ; 514 ;
323 515
324 class_<pst_item>("pst_item") 516 class_<pst_item>("pst_item")
325 .add_property("email", make_getter(&pst_item::email, return_value_policy<reference_existing_object>())) 517 .add_property("email", make_getter(&pst_item::email, return_value_policy<reference_existing_object>()))
326 .add_property("folder", make_getter(&pst_item::folder, return_value_policy<reference_existing_object>())) 518 .add_property("folder", make_getter(&pst_item::folder, return_value_policy<reference_existing_object>()))
349 .add_property("modify_date", make_getter(&pst_item::modify_date, return_value_policy<reference_existing_object>())) 541 .add_property("modify_date", make_getter(&pst_item::modify_date, return_value_policy<reference_existing_object>()))
350 .def_readonly("private_member", &pst_item::private_member) 542 .def_readonly("private_member", &pst_item::private_member)
351 ; 543 ;
352 544
353 class_<pst_x_attrib_ll>("pst_x_attrib_ll") 545 class_<pst_x_attrib_ll>("pst_x_attrib_ll")
354 .def_readonly("mytype", &pst_x_attrib_ll::mytype) 546 .def_readonly("mytype", &pst_x_attrib_ll::mytype)
355 .def_readonly("map", &pst_x_attrib_ll::map) 547 .def_readonly("map", &pst_x_attrib_ll::map)
356 .def_readonly("data", &pst_x_attrib_ll::data) 548 .def_readonly("data", &pst_x_attrib_ll::data)
357 .def_readonly("next", &pst_x_attrib_ll::next) 549 .add_property("next", make_getter(&pst_x_attrib_ll::next, return_value_policy<reference_existing_object>()))
358 ; 550 ;
359 551
360 class_<pst_file>("pst_file") 552 class_<pst_file>("pst_file")
361 .add_property("i_head", make_getter(&pst_file::i_head, return_value_policy<reference_existing_object>())) 553 .add_property("i_head", make_getter(&pst_file::i_head, return_value_policy<reference_existing_object>()))
362 .add_property("i_tail", make_getter(&pst_file::i_tail, return_value_policy<reference_existing_object>())) 554 .add_property("i_tail", make_getter(&pst_file::i_tail, return_value_policy<reference_existing_object>()))
363 .add_property("d_head", make_getter(&pst_file::d_head, return_value_policy<reference_existing_object>())) 555 .add_property("d_head", make_getter(&pst_file::d_head, return_value_policy<reference_existing_object>()))
364 .add_property("d_tail", make_getter(&pst_file::d_tail, return_value_policy<reference_existing_object>())) 556 .add_property("d_tail", make_getter(&pst_file::d_tail, return_value_policy<reference_existing_object>()))
557 .add_property("x_head", make_getter(&pst_file::x_head, return_value_policy<reference_existing_object>()))
365 .def_readonly("do_read64", &pst_file::do_read64) 558 .def_readonly("do_read64", &pst_file::do_read64)
366 .def_readonly("index1", &pst_file::index1) 559 .def_readonly("index1", &pst_file::index1)
367 .def_readonly("index1_back", &pst_file::index1_back) 560 .def_readonly("index1_back", &pst_file::index1_back)
368 .def_readonly("index2", &pst_file::index2) 561 .def_readonly("index2", &pst_file::index2)
369 .def_readonly("index2_back", &pst_file::index2_back) 562 .def_readonly("index2_back", &pst_file::index2_back)
388 .def("pst_rfc2425_datetime_format", &pst::pst_rfc2425_datetime_format) 581 .def("pst_rfc2425_datetime_format", &pst::pst_rfc2425_datetime_format)
389 .def("pst_rfc2445_datetime_format", &pst::pst_rfc2445_datetime_format) 582 .def("pst_rfc2445_datetime_format", &pst::pst_rfc2445_datetime_format)
390 .def("pst_default_charset", &pst::pst_default_charset) 583 .def("pst_default_charset", &pst::pst_default_charset)
391 .def("pst_convert_utf8_null", &pst::pst_convert_utf8_null) 584 .def("pst_convert_utf8_null", &pst::pst_convert_utf8_null)
392 .def("pst_convert_utf8", &pst::pst_convert_utf8) 585 .def("pst_convert_utf8", &pst::pst_convert_utf8)
393 ; 586 .def("ppst_open_file", &pst::ppst_open_file, return_value_policy<reference_existing_object>())
394 } 587 .def("ppst_close_file", &pst::ppst_close_file)
395 588 ;
396 589 }
590
591