summaryrefslogtreecommitdiff
path: root/walk.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-05 23:51:20 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-05 23:51:20 -0400
commit6048ae7c05622a83355ad0a87ab1ce512f00b3f3 (patch)
treed8467e4cafbd93edf7923f9431751563907ab2a9 /walk.h
parent5409bc04b8535ba2b52096475d759462c8cd9876 (diff)
downloadfork-ledger-6048ae7c05622a83355ad0a87ab1ce512f00b3f3.tar.gz
fork-ledger-6048ae7c05622a83355ad0a87ab1ce512f00b3f3.tar.bz2
fork-ledger-6048ae7c05622a83355ad0a87ab1ce512f00b3f3.zip
fixed cache by clear transaction flags before writing
Diffstat (limited to 'walk.h')
-rw-r--r--walk.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/walk.h b/walk.h
index 2bc578a1..2cc6f2e3 100644
--- a/walk.h
+++ b/walk.h
@@ -165,6 +165,31 @@ void walk_entries(entries_list::iterator begin,
}
template <typename Function>
+void walk_entries(entries_list::iterator begin,
+ entries_list::iterator end, Function functor)
+{
+ for (entries_list::iterator i = begin; i != end; i++)
+ for (transactions_list::iterator j = (*i)->transactions.begin();
+ j != (*i)->transactions.end();
+ j++)
+ functor(*j);
+}
+
+class clear_flags
+{
+ public:
+ void operator()(transaction_t * xact) const {
+ xact->flags &= ~(TRANSACTION_HANDLED | TRANSACTION_DISPLAYED);
+ }
+};
+
+inline void clear_transaction_display_flags(entries_list::iterator begin,
+ entries_list::iterator end)
+{
+ walk_entries<clear_flags>(begin, end, clear_flags());
+}
+
+template <typename Function>
void walk_transactions(transactions_list::iterator begin,
transactions_list::iterator end, Function functor)
{