diff options
author | John Wiegley <johnw@newartisans.com> | 2004-11-08 06:43:11 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:40:47 -0400 |
commit | c9fb11bd60a2170fb896d77ff8d7706f563ad597 (patch) | |
tree | 42bdf09e7d8727ba31d1d8dae9b4eb4b2a605441 /parser.h | |
parent | fa2ceaed13c031add578ee8eb33da0c9980b9fb1 (diff) | |
download | fork-ledger-c9fb11bd60a2170fb896d77ff8d7706f563ad597.tar.gz fork-ledger-c9fb11bd60a2170fb896d77ff8d7706f563ad597.tar.bz2 fork-ledger-c9fb11bd60a2170fb896d77ff8d7706f563ad597.zip |
updated to version 2.0
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/parser.h b/parser.h new file mode 100644 index 00000000..515bf09b --- /dev/null +++ b/parser.h @@ -0,0 +1,40 @@ +#ifndef _PARSER_H +#define _PARSER_H + +#include <iostream> +#include <string> + +namespace ledger { + +class account_t; +class journal_t; + +class parser_t +{ + public: + virtual ~parser_t() {} + + virtual bool test(std::istream& in) const = 0; + + virtual unsigned int parse(std::istream& in, + journal_t * journal, + account_t * master = NULL, + const std::string * original_file = NULL) = 0; +}; + +bool register_parser(parser_t * parser); +bool unregister_parser(parser_t * parser); + +unsigned int parse_journal(std::istream& in, + journal_t * journal, + account_t * master = NULL, + const std::string * original_file = NULL); + +unsigned int parse_journal_file(const std::string& path, + journal_t * journal, + account_t * master = NULL, + const std::string * original_file = NULL); + +} // namespace ledger + +#endif // _PARSER_H |