summaryrefslogtreecommitdiff
path: root/format.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-07-31 07:42:34 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-07-31 07:42:34 -0400
commitf570e6644fce27b612562282b11d00fd0691873d (patch)
treecc6da9b59aed82e17f9e946e6e1ac1ac92257280 /format.h
parent2a9e778b7d359a009d7a1f2432bf6d0dcf2fab7d (diff)
downloadfork-ledger-f570e6644fce27b612562282b11d00fd0691873d.tar.gz
fork-ledger-f570e6644fce27b612562282b11d00fd0691873d.tar.bz2
fork-ledger-f570e6644fce27b612562282b11d00fd0691873d.zip
brought back the "print" and "equity" reports; this time much better!
Diffstat (limited to 'format.h')
-rw-r--r--format.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/format.h b/format.h
index 12af7d8e..f2bdad10 100644
--- a/format.h
+++ b/format.h
@@ -16,9 +16,12 @@ struct element_t
STRING,
VALUE_EXPR,
DATE_STRING,
+ CLEARED,
+ CODE,
PAYEE,
ACCOUNT_NAME,
ACCOUNT_FULLNAME,
+ OPT_AMOUNT,
VALUE,
TOTAL,
SPACER
@@ -47,8 +50,8 @@ struct format_t
{
element_t * elements;
- static node_t * value_expr;
- static node_t * total_expr;
+ static std::auto_ptr<node_t> value_expr;
+ static std::auto_ptr<node_t> total_expr;
format_t(const std::string& _format) {
elements = parse_elements(_format);
@@ -63,10 +66,10 @@ struct format_t
const item_t * displayed_parent = NULL) const;
static balance_t compute_value(const item_t * item) {
- return value_expr ? value_expr->compute(item) : balance_t();
+ return value_expr.get() ? value_expr->compute(item) : balance_t();
}
static balance_t compute_total(const item_t * item) {
- return total_expr ? total_expr->compute(item) : balance_t();
+ return total_expr.get() ? total_expr->compute(item) : balance_t();
}
};