summaryrefslogtreecommitdiff
path: root/binary.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-27 23:38:39 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-27 23:38:39 -0400
commit16841fbae3adcb0a143d709e2597ce543bff084e (patch)
tree9683e8e1b4442b99e2d7f2e26cf409c89c0f10a6 /binary.cc
parentf0238fdd065ace9edbb65a45875f2f47a7a932d6 (diff)
downloadfork-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.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/binary.cc b/binary.cc
index d055406b..088a6bd8 100644
--- a/binary.cc
+++ b/binary.cc
@@ -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