diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-05 22:49:18 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-05 22:49:18 -0400 |
commit | ef2e0beb6409e4ae6f0641700ea00e3a0f20d305 (patch) | |
tree | 9084c11718038327e2a44a4f596a499281fa7510 /format.h | |
parent | 50f75e0a5c3ee31c2bcc1fcbd8da42e24ccf072f (diff) | |
download | fork-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.h | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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; |