diff options
Diffstat (limited to 'parser.cc')
-rw-r--r-- | parser.cc | 48 |
1 files changed, 0 insertions, 48 deletions
@@ -191,51 +191,3 @@ unsigned int parse_ledger_data(journal_t * journal, config_t& config) } } // namespace ledger - -#ifdef USE_BOOST_PYTHON - -#include <boost/python.hpp> -#include <Python.h> - -using namespace boost::python; -using namespace ledger; - -struct parser_wrap : public parser_t -{ - PyObject * self; - parser_wrap(PyObject * self_) : self(self_) {} - - virtual bool test(std::istream& in) const { - return call_method<bool>(self, "test", in); - } - - virtual unsigned int parse(std::istream& in, - journal_t * journal, - account_t * master = NULL, - const std::string * original_file = NULL) { - return call_method<unsigned int>(self, "__call__", in, journal, master, - original_file); - } -}; - -BOOST_PYTHON_FUNCTION_OVERLOADS(parse_journal_overloads, parse_journal, 2, 4) -BOOST_PYTHON_FUNCTION_OVERLOADS(parse_journal_file_overloads, - parse_journal_file, 2, 4) - -BOOST_PYTHON_FUNCTION_OVERLOADS(parse_ledger_data_overloads, - parse_ledger_data, 1, 2) - -void export_parser() { - class_< parser_t, parser_wrap, boost::noncopyable > ("Parser") - ; - - def("register_parser", register_parser); - def("unregister_parser", unregister_parser); - def("parse_journal", parse_journal, parse_journal_overloads()); - def("parse_journal_file", parse_journal_file, parse_journal_file_overloads()); -#if 0 - def("parse_ledger_data", parse_ledger_data, parse_ledger_data_overloads()); -#endif -} - -#endif // USE_BOOST_PYTHON |