summaryrefslogtreecommitdiff
path: root/format.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-05 22:49:18 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-05 22:49:18 -0400
commitef2e0beb6409e4ae6f0641700ea00e3a0f20d305 (patch)
tree9084c11718038327e2a44a4f596a499281fa7510 /format.h
parent50f75e0a5c3ee31c2bcc1fcbd8da42e24ccf072f (diff)
downloadfork-ledger-ef2e0beb6409e4ae6f0641700ea00e3a0f20d305.tar.gz
fork-ledger-ef2e0beb6409e4ae6f0641700ea00e3a0f20d305.tar.bz2
fork-ledger-ef2e0beb6409e4ae6f0641700ea00e3a0f20d305.zip
fixed the "-o bal rent" report again
Diffstat (limited to 'format.h')
-rw-r--r--format.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/format.h b/format.h
index 7fc46985..c61518be 100644
--- a/format.h
+++ b/format.h
@@ -54,13 +54,19 @@ struct format_t
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);
+ format_t(const std::string& _format) : elements(NULL) {
+ reset(_format);
}
~format_t() {
if (elements) delete elements;
}
+ void reset(const std::string& _format) {
+ if (elements)
+ delete elements;
+ elements = parse_elements(_format);
+ }
+
static element_t * parse_elements(const std::string& fmt);
void format_elements(std::ostream& out, const details_t& details) const;