From ef2e0beb6409e4ae6f0641700ea00e3a0f20d305 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 5 Aug 2004 22:49:18 -0400 Subject: fixed the "-o bal rent" report again --- format.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'format.h') 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 value_expr; static std::auto_ptr 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; -- cgit v1.2.3