diff options
author | John Wiegley <johnw@newartisans.com> | 2004-07-30 21:57:02 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-07-30 21:57:02 -0400 |
commit | 94e76ae87e883291d13320738fe165c7a2a2415b (patch) | |
tree | b90eff2ee3737ecdfea96dbee52ecd239fcb2578 /constraint.h | |
parent | 5087a60deef7c618a07562511e9a1fbf2414776c (diff) | |
download | fork-ledger-94e76ae87e883291d13320738fe165c7a2a2415b.tar.gz fork-ledger-94e76ae87e883291d13320738fe165c7a2a2415b.tar.bz2 fork-ledger-94e76ae87e883291d13320738fe165c7a2a2415b.zip |
two major changes
Complete changed the way format strings are handled. They are now
compiled first, which is far more efficient than what was being done
before.
Also, there is now a global ledger::commodity_t::commodities map,
which saves me from having to pass the current journal around to a
zillion different functions, for the sole purpose of making sure that
all commodity symbols that are parsed refer to the same commodity
object.
Diffstat (limited to 'constraint.h')
-rw-r--r-- | constraint.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/constraint.h b/constraint.h index f7ecef62..79e01fc6 100644 --- a/constraint.h +++ b/constraint.h @@ -104,9 +104,7 @@ class constraints_t bool show_empty; std::time_t begin_date; - bool have_beginning; std::time_t end_date; - bool have_ending; struct std::tm date_mask; bool have_date_mask; @@ -128,8 +126,8 @@ class constraints_t show_subtotals = true; show_empty = false; - have_beginning = false; - have_ending = false; + begin_date = -1; + end_date = -1; have_date_mask = false; period = PERIOD_NONE; @@ -140,11 +138,11 @@ class constraints_t ~constraints_t(); std::time_t begin() const { - return have_beginning ? begin_date : 0; + return begin_date == -1 ? 0 : begin_date; } std::time_t end() const { - return have_ending ? end_date : std::time(NULL); + return end_date == -1 ? std::time(NULL) : end_date; } bool matches_date_range(const std::time_t date) const; |