summaryrefslogtreecommitdiff
path: root/parser.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-02-16 01:01:38 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:23 -0400
commit4aea9709bb25a3be567ad8c25cdd4458e813a10f (patch)
treeab9f540eb655848acc8f324afe171775affe2f39 /parser.h
parent17e872689ead6d2250af3997c3944b081b4ad9ef (diff)
downloadfork-ledger-4aea9709bb25a3be567ad8c25cdd4458e813a10f.tar.gz
fork-ledger-4aea9709bb25a3be567ad8c25cdd4458e813a10f.tar.bz2
fork-ledger-4aea9709bb25a3be567ad8c25cdd4458e813a10f.zip
Made several changes to the parsing infrastructure to allow passing
the "config_t" object around. This is needed for parsing option settings in the initialization file.
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h23
1 files changed, 9 insertions, 14 deletions
diff --git a/parser.h b/parser.h
index d163e5e9..396f0fe6 100644
--- a/parser.h
+++ b/parser.h
@@ -8,6 +8,7 @@ namespace ledger {
class account_t;
class journal_t;
+class config_t;
class parser_t
{
@@ -17,6 +18,7 @@ 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;
@@ -26,29 +28,22 @@ 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_file(const std::string& path,
+ config_t& config,
journal_t * journal,
account_t * master = NULL,
const std::string * original_file = NULL);
-unsigned int parse_ledger_data(journal_t * journal,
- const std::string& data_file,
- const std::string& init_file = "",
- const std::string& price_db = "",
- bool use_cache = false,
- const std::string& cache_file = "",
- bool * cache_dirty = NULL,
- parser_t * cache_parser = NULL,
- parser_t * xml_parser = NULL,
- parser_t * stdin_parser = NULL,
- const std::string& default_account = "");
-
-class config_t;
-unsigned int parse_ledger_data(journal_t * journal, config_t& config);
+unsigned int parse_ledger_data(config_t& config,
+ journal_t * journal,
+ parser_t * cache_parser = NULL,
+ parser_t * xml_parser = NULL,
+ parser_t * stdin_parser = NULL);
void initialize_parser_support();
void shutdown_parser_support();