summaryrefslogtreecommitdiff
path: root/binary.cc
diff options
context:
space:
mode:
Diffstat (limited to 'binary.cc')
-rw-r--r--binary.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/binary.cc b/binary.cc
index 98e3be16..c328dfe8 100644
--- a/binary.cc
+++ b/binary.cc
@@ -1,6 +1,7 @@
#include "ledger.h"
#include "binary.h"
+#include <fstream>
#include <ctime>
#include <sys/stat.h>
@@ -612,11 +613,19 @@ using namespace ledger;
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(binary_parse_overloads,
binary_parser_t::parse, 2, 4)
+void py_write_binary_journal(const std::string& path, journal_t * journal)
+{
+ std::ofstream out(path.c_str());
+ write_binary_journal(out, journal, &journal->sources);
+}
+
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())
;
+
+ def("write_binary_journal", py_write_binary_journal);
}
#endif // USE_BOOST_PYTHON