summaryrefslogtreecommitdiff
path: root/src/times.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-03-15 04:03:17 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-03-15 23:51:46 -0400
commit585b3a246d51ce50d3085d406079bc63588673dd (patch)
tree2837a6256b2d5ab5b52eef3feecc9546434469e4 /src/times.h
parenta05353e26928464b485767cc843ec5b3d9e47040 (diff)
downloadfork-ledger-585b3a246d51ce50d3085d406079bc63588673dd.tar.gz
fork-ledger-585b3a246d51ce50d3085d406079bc63588673dd.tar.bz2
fork-ledger-585b3a246d51ce50d3085d406079bc63588673dd.zip
Added feature to "align" the interval's start date
Diffstat (limited to 'src/times.h')
-rw-r--r--src/times.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/times.h b/src/times.h
index 3ed3621d..eb58a97f 100644
--- a/src/times.h
+++ b/src/times.h
@@ -138,6 +138,7 @@ public:
const duration_t& duration);
optional<date_t> start;
+ bool aligned;
optional<duration_t> skip_duration;
std::size_t factor;
optional<date_t> next;
@@ -145,10 +146,10 @@ public:
optional<date_t> end_of_duration;
optional<date_t> end;
- explicit date_interval_t() : factor(1) {
+ explicit date_interval_t() : aligned(false), factor(1) {
TRACE_CTOR(date_interval_t, "");
}
- date_interval_t(const string& str) : factor(1) {
+ date_interval_t(const string& str) : aligned(false), factor(1) {
TRACE_CTOR(date_interval_t, "const string&");
parse(str);
}
@@ -182,6 +183,9 @@ public:
parse(in);
}
+ void resolve_end();
+ void stabilize(const optional<date_t>& date = none);
+
bool is_valid() const {
return start;
}