diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-01 03:31:28 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-01 03:31:28 -0600 |
commit | 944e580825f0d9ce060b6dcdffe8990b6c2cca20 (patch) | |
tree | e2651b0df622d9b8d3831f35743e7dbd31c16897 /src/journal.h | |
parent | e2afc783db0dff1927b00dc506390353d9e3bbd2 (diff) | |
download | fork-ledger-944e580825f0d9ce060b6dcdffe8990b6c2cca20.tar.gz fork-ledger-944e580825f0d9ce060b6dcdffe8990b6c2cca20.tar.bz2 fork-ledger-944e580825f0d9ce060b6dcdffe8990b6c2cca20.zip |
Refactored the notion of "the current parsing context"
Diffstat (limited to 'src/journal.h')
-rw-r--r-- | src/journal.h | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/journal.h b/src/journal.h index 6d10ffda..8b750993 100644 --- a/src/journal.h +++ b/src/journal.h @@ -55,7 +55,8 @@ class auto_xact_t; class period_xact_t; class post_t; class account_t; -class scope_t; +class parse_context_t; +class parse_context_stack_t; typedef std::list<xact_t *> xacts_list; typedef std::list<auto_xact_t *> auto_xacts_list; @@ -132,6 +133,7 @@ public: account_mappings_t payees_for_unknown_accounts; checksum_map_t checksum_map; tag_check_exprs_map tag_check_exprs; + parse_context_t * current_context; bool was_loaded; bool force_checking; bool check_payees; @@ -143,8 +145,10 @@ public: } checking_style; journal_t(); +#if 0 journal_t(const path& pathname); journal_t(const string& str); +#endif ~journal_t(); void initialize(); @@ -162,16 +166,12 @@ public: account_t * find_account_re(const string& regexp); account_t * register_account(const string& name, post_t * post, - const string& location, account_t * master = NULL); - string register_payee(const string& name, xact_t * xact, - const string& location); + string register_payee(const string& name, xact_t * xact); void register_commodity(commodity_t& comm, - variant<int, xact_t *, post_t *> context, - const string& location); + variant<int, xact_t *, post_t *> context); void register_metadata(const string& key, const value_t& value, - variant<int, xact_t *, post_t *> context, - const string& location); + variant<int, xact_t *, post_t *> context); bool add_xact(xact_t * xact); void extend_xact(xact_base_t * xact); @@ -196,24 +196,16 @@ public: return period_xacts.end(); } - std::size_t read(std::istream& in, - const path& pathname, - account_t * master = NULL, - scope_t * scope = NULL); - std::size_t read(const path& pathname, - account_t * master = NULL, - scope_t * scope = NULL); - - std::size_t parse(std::istream& in, - scope_t& session_scope, - account_t * master = NULL, - const path * original_file = NULL); + std::size_t read(parse_context_stack_t& context); bool has_xdata(); void clear_xdata(); bool valid() const; +private: + std::size_t read_textual(parse_context_stack_t& context); + #if defined(HAVE_BOOST_SERIALIZATION) private: /** Serialization. */ |