diff options
author | John Wiegley <johnw@newartisans.com> | 2009-03-16 04:02:56 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-03-16 04:02:56 -0400 |
commit | d0ea10f9a709de8f67b4c4eb1e763ab32309957f (patch) | |
tree | 4e968c574a1c84bbf23493b57bfe61e4ac852cf7 /src/report.h | |
parent | 63080a727540e5168d6eb230e86d06ad390dc6c5 (diff) | |
parent | f1523b5464924bf9d9987fce0cb3dbe4acda5a4b (diff) | |
download | fork-ledger-d0ea10f9a709de8f67b4c4eb1e763ab32309957f.tar.gz fork-ledger-d0ea10f9a709de8f67b4c4eb1e763ab32309957f.tar.bz2 fork-ledger-d0ea10f9a709de8f67b4c4eb1e763ab32309957f.zip |
Rewrote the interval_t class
The purpose of this rewrite is to greatly simplify the code that walks
through time periods, toward opening up the possibility in future of
allowing exclusions and logically combined periods, such as "weekly
except weekends". The new code is much simpler to use, as well as
simpler internally, and yet is more robust at the same time.
Diffstat (limited to 'src/report.h')
-rw-r--r-- | src/report.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/report.h b/src/report.h index 55c37b22..5eb2a706 100644 --- a/src/report.h +++ b/src/report.h @@ -240,14 +240,14 @@ public: }); OPTION_(report_t, begin_, DO_(args) { // -b - interval_t interval(args[0].to_string()); - if (! is_valid(interval.begin)) + date_interval_t interval(args[0].to_string()); + if (! interval.start) throw_(std::invalid_argument, _("Could not determine beginning of period '%1'") << args[0].to_string()); string predicate = - "date>=[" + to_iso_extended_string(interval.begin) + "]"; + "date>=[" + to_iso_extended_string(*interval.start) + "]"; parent->HANDLER(limit_).on(predicate); }); @@ -355,14 +355,14 @@ public: OPTION(report_t, empty); // -E OPTION_(report_t, end_, DO_(args) { // -e - interval_t interval(args[0].to_string()); - if (! is_valid(interval.begin)) + date_interval_t interval(args[0].to_string()); + if (! interval.start) throw_(std::invalid_argument, _("Could not determine end of period '%1'") << args[0].to_string()); string predicate = - "date<[" + to_iso_extended_string(interval.begin) + "]"; + "date<[" + to_iso_extended_string(*interval.start) + "]"; parent->HANDLER(limit_).on(predicate); #if 0 terminus = interval.begin; |