diff options
author | John Wiegley <johnw@newartisans.com> | 2008-05-08 02:19:44 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-05-08 02:50:19 -0400 |
commit | d159501993cfd0215f94f0e5e16796558417b681 (patch) | |
tree | b0e2b9e9e707dd3f71683e81b9c9c3a1f8b47f86 /parser.h | |
parent | 7ecbf3e125481a02c541f9eb3ed795ac3e245541 (diff) | |
download | fork-ledger-d159501993cfd0215f94f0e5e16796558417b681.tar.gz fork-ledger-d159501993cfd0215f94f0e5e16796558417b681.tar.bz2 fork-ledger-d159501993cfd0215f94f0e5e16796558417b681.zip |
The code is compiling again, but it's far from being able to run yet.
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 49 |
1 files changed, 29 insertions, 20 deletions
@@ -1,10 +1,7 @@ #ifndef _PARSER_H #define _PARSER_H -#include <iostream> -#include <string> - -#include "error.h" +#include "utils.h" namespace ledger { @@ -19,27 +16,39 @@ class parser_t virtual bool test(std::istream& in) const = 0; - virtual unsigned int parse(std::istream& in, - config_t& config, - journal_t * journal, - account_t * master = NULL, - const std::string * original_file = NULL) = 0; + virtual unsigned int parse(std::istream& in, + config_t& config, + journal_t * journal, + account_t * master = NULL, + const path * original_file = NULL) = 0; +}; + +class binary_parser_t : public parser_t +{ +public: + virtual bool test(std::istream& in) const; + + virtual unsigned int parse(std::istream& in, + config_t& config, + journal_t * journal, + account_t * master = NULL, + const path * original_file = NULL); }; bool register_parser(parser_t * parser); bool unregister_parser(parser_t * parser); -unsigned int parse_journal(std::istream& in, - config_t& config, - journal_t * journal, - account_t * master = NULL, - const std::string * original_file = NULL); +unsigned int parse_journal(std::istream& in, + config_t& config, + journal_t * journal, + account_t * master = NULL, + const path * original_file = NULL); -unsigned int parse_journal_file(const std::string& path, - config_t& config, - journal_t * journal, - account_t * master = NULL, - const std::string * original_file = NULL); +unsigned int parse_journal_file(const path& path, + config_t& config, + journal_t * journal, + account_t * master = NULL, + const path * original_file = NULL); unsigned int parse_ledger_data(config_t& config, journal_t * journal, @@ -52,7 +61,7 @@ void shutdown_parser_support(); class parse_error : public error { public: - parse_error(const std::string& reason, error_context * ctxt = NULL) throw() + parse_error(const string& reason, error_context * ctxt = NULL) throw() : error(reason, ctxt) {} virtual ~parse_error() throw() {} }; |