From ef6161fefb09253b9de6d228c92ce41b3a0063dc Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 30 Sep 2003 03:22:38 +0000 Subject: *** empty log message *** --- ledger.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'ledger.h') diff --git a/ledger.h b/ledger.h index 8cee10df..7e9a48f5 100644 --- a/ledger.h +++ b/ledger.h @@ -1,5 +1,5 @@ #ifndef _LEDGER_H -#define _LEDGER_H "$Revision: 1.3 $" +#define _LEDGER_H "$Revision: 1.4 $" ////////////////////////////////////////////////////////////////////// // @@ -90,11 +90,15 @@ struct commodity bool prefix; bool separate; + bool thousands; + bool european; int precision; - commodity() : prefix(false), separate(true) {} - commodity(const std::string& sym, bool pre, bool sep, int prec); + commodity() : prefix(false), separate(true), + thousands(false), european(false) {} + commodity(const std::string& sym, bool pre, bool sep, + bool thou, bool euro, int prec); }; typedef std::map commodities_t; @@ -102,11 +106,11 @@ typedef commodities_t::iterator commodities_iterator; typedef std::pair commodities_entry; extern commodities_t commodities; -extern commodity * commodity_usd; -inline commodity::commodity(const std::string& sym, - bool pre, bool sep, int prec) - : symbol(sym), prefix(pre), separate(sep), precision(prec) { +inline commodity::commodity(const std::string& sym, bool pre, bool sep, + bool thou, bool euro, int prec) + : symbol(sym), prefix(pre), separate(sep), + thousands(thou), european(euro), precision(prec) { std::pair result = commodities.insert(commodities_entry(sym, this)); assert(result.second); @@ -129,12 +133,14 @@ class amount // Assignment virtual void credit(const amount * other) = 0; + virtual void negate() = 0; virtual void operator+=(const amount& other) = 0; // String conversion routines virtual void parse(const char * num) = 0; virtual amount& operator=(const char * num) = 0; + virtual std::string as_str(bool full_prec = false) const = 0; virtual operator std::string() const = 0; }; @@ -272,6 +278,8 @@ typedef std::pair accounts_entry; extern accounts_t accounts; +extern bool use_warnings; + } // namespace ledger #endif // _LEDGER_H -- cgit v1.2.3