diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-27 23:38:39 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-27 23:38:39 -0400 |
commit | 16841fbae3adcb0a143d709e2597ce543bff084e (patch) | |
tree | 9683e8e1b4442b99e2d7f2e26cf409c89c0f10a6 /binary.cc | |
parent | f0238fdd065ace9edbb65a45875f2f47a7a932d6 (diff) | |
download | fork-ledger-16841fbae3adcb0a143d709e2597ce543bff084e.tar.gz fork-ledger-16841fbae3adcb0a143d709e2597ce543bff084e.tar.bz2 fork-ledger-16841fbae3adcb0a143d709e2597ce543bff084e.zip |
added (disabled) code for Boost.Python
Diffstat (limited to 'binary.cc')
-rw-r--r-- | binary.cc | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -175,7 +175,6 @@ inline void read_binary_amount(char *& data, amount_t& amt) inline void read_binary_transaction(char *& data, transaction_t * xact) { xact->account = accounts[read_binary_number<account_t::ident_t>(data) - 1]; - xact->account->add_transaction(xact); read_binary_amount(data, xact->amount); @@ -601,3 +600,22 @@ void write_binary_journal(std::ostream& out, journal_t * journal, } } // namespace ledger + +#ifdef USE_BOOST_PYTHON + +#include <boost/python.hpp> + +using namespace boost::python; +using namespace ledger; + +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(binary_parse_overloads, + binary_parser_t::parse, 2, 4) + +void export_binary() { + class_< binary_parser_t, bases<parser_t> > ("BinaryParser") + .def("test", &binary_parser_t::test) + .def("parse", &binary_parser_t::parse, binary_parse_overloads()) + ; +} + +#endif // USE_BOOST_PYTHON |