summaryrefslogtreecommitdiff
path: root/src/post.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-02-05 05:35:14 -0500
committerJohn Wiegley <johnw@newartisans.com>2010-02-05 05:35:14 -0500
commit547137096051ab985dca6f8e5c7be191b62ccb0c (patch)
tree2f3a39c4b71b8cb8b232502401e8dd2c8c2247ef /src/post.h
parentc6873d32aa121289e87be7eb16ff531c6d468d2a (diff)
parent69da18cd303b10f9badd542141ffdfd546009508 (diff)
downloadfork-ledger-547137096051ab985dca6f8e5c7be191b62ccb0c.tar.gz
fork-ledger-547137096051ab985dca6f8e5c7be191b62ccb0c.tar.bz2
fork-ledger-547137096051ab985dca6f8e5c7be191b62ccb0c.zip
Merge branch 'next'
Diffstat (limited to 'src/post.h')
-rw-r--r--src/post.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/post.h b/src/post.h
index a0ab5ffd..8852e7b2 100644
--- a/src/post.h
+++ b/src/post.h
@@ -105,6 +105,7 @@ public:
const optional<mask_t>& value_mask = none) const;
virtual date_t date() const;
+ virtual date_t actual_date() const;
virtual optional<date_t> effective_date() const;
bool must_balance() const {
@@ -114,6 +115,8 @@ public:
virtual expr_t::ptr_op_t lookup(const symbol_t::kind_t kind,
const string& name);
+ amount_t resolve_expr(scope_t& scope, expr_t& expr);
+
bool valid() const;
struct xdata_t : public supports_flags<uint_least16_t>
@@ -198,6 +201,20 @@ public:
friend class xact_t;
+ struct compare_by_date_and_sequence
+ {
+ bool operator()(const post_t * left, const post_t * right) const {
+ gregorian::date_duration duration =
+ left->actual_date() - right->actual_date();
+ if (duration.days() == 0) {
+ return ((left->pos ? left->pos->sequence : 0) <
+ (right->pos ? right->pos->sequence : 0));
+ } else {
+ return duration.days() < 0;
+ }
+ }
+ };
+
#if defined(HAVE_BOOST_SERIALIZATION)
private:
/** Serialization. */