diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-12 05:09:25 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-12 05:11:06 -0500 |
commit | 48dc654eda27c01d0bad88674d21d0e33e5472f6 (patch) | |
tree | bfb05ee0d302c68b36942741f65fa0a243b0a96e /src/account.cc | |
parent | 0068ac8fc06d00ba5172e5ddbd4f00cc4168681d (diff) | |
download | fork-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/account.cc')
-rw-r--r-- | src/account.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/account.cc b/src/account.cc index 5cc7e070..da43745a 100644 --- a/src/account.cc +++ b/src/account.cc @@ -327,16 +327,25 @@ bool account_t::valid() const return true; } +bool account_t::children_with_xdata() const +{ + foreach (const accounts_map::value_type& pair, accounts) + if (pair.second->has_xdata() || + pair.second->children_with_xdata()) + return true; + + return false; +} + std::size_t account_t::children_with_flags(xdata_t::flags_t flags) const { std::size_t count = 0; bool grandchildren_visited = false; - foreach (const accounts_map::value_type& pair, accounts) { + foreach (const accounts_map::value_type& pair, accounts) if (pair.second->has_xflags(flags) || pair.second->children_with_flags(flags)) count++; - } // Although no immediately children were visited, if any progeny at all were // visited, it counts as one. |