summaryrefslogtreecommitdiff
path: root/src/journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-12 05:09:25 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-12 05:11:06 -0500
commit48dc654eda27c01d0bad88674d21d0e33e5472f6 (patch)
treebfb05ee0d302c68b36942741f65fa0a243b0a96e /src/journal.cc
parent0068ac8fc06d00ba5172e5ddbd4f00cc4168681d (diff)
downloadfork-ledger-48dc654eda27c01d0bad88674d21d0e33e5472f6.tar.gz
fork-ledger-48dc654eda27c01d0bad88674d21d0e33e5472f6.tar.bz2
fork-ledger-48dc654eda27c01d0bad88674d21d0e33e5472f6.zip
Added has_xdata() methods for journal_t and xact_t
Diffstat (limited to 'src/journal.cc')
-rw-r--r--src/journal.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/journal.cc b/src/journal.cc
index c764dbce..2366ce30 100644
--- a/src/journal.cc
+++ b/src/journal.cc
@@ -211,6 +211,26 @@ std::size_t journal_t::read(const path& pathname,
return count;
}
+bool journal_t::has_xdata()
+{
+ foreach (xact_t * xact, xacts)
+ if (xact->has_xdata())
+ return true;
+
+ foreach (auto_xact_t * xact, auto_xacts)
+ if (xact->has_xdata())
+ return true;
+
+ foreach (period_xact_t * xact, period_xacts)
+ if (xact->has_xdata())
+ return true;
+
+ if (master->has_xdata() || master->children_with_xdata())
+ return true;
+
+ return false;
+}
+
void journal_t::clear_xdata()
{
foreach (xact_t * xact, xacts)