summaryrefslogtreecommitdiff
path: root/session.cc
diff options
context:
space:
mode:
Diffstat (limited to 'session.cc')
-rw-r--r--session.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/session.cc b/session.cc
index 9e8806a8..55d73b0a 100644
--- a/session.cc
+++ b/session.cc
@@ -31,6 +31,7 @@
#include "session.h"
#include "parsexp.h"
+#include "walk.h"
namespace ledger {
@@ -210,6 +211,7 @@ std::size_t session_t::read_data(journal_t& journal,
entry_count += read_journal(journal, data_file, acct);
if (journal.price_db)
journal.sources.push_back(*journal.price_db);
+ clean_accounts();
}
}
@@ -241,6 +243,26 @@ account_t * session_t::find_account_re(const string& regexp)
return find_account_re_(master, mask_t(regexp));
}
+void session_t::clean_transactions()
+{
+ session_transactions_iterator walker(*this);
+ pass_down_transactions
+ (xact_handler_ptr(new clear_transaction_xdata), walker);
+}
+
+void session_t::clean_transactions(entry_t& entry)
+{
+ entry_transactions_iterator walker(entry);
+ pass_down_transactions(xact_handler_ptr(new clear_transaction_xdata), walker);
+}
+
+void session_t::clean_accounts()
+{
+ accounts_iterator acct_walker(*master);
+ pass_down_accounts<accounts_iterator>
+ (acct_handler_ptr(new clear_account_xdata), acct_walker);
+}
+
#if 0
value_t session_t::resolve(const string& name, expr::scope_t& locals)
{