From 9b7725ee181617b2e0ea13189837b0724ab964b8 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 26 Jul 2008 23:55:06 -0400 Subject: Added a simple optimization to the way amount strings are parsed. --- amount.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'amount.h') diff --git a/amount.h b/amount.h index 3df04c1d..ef1d2a3d 100644 --- a/amount.h +++ b/amount.h @@ -263,9 +263,10 @@ class amount_t #define AMOUNT_PARSE_NO_MIGRATE 0x01 #define AMOUNT_PARSE_NO_REDUCE 0x02 +#define AMOUNT_PARSE_SOFT_FAIL 0x04 - void parse(std::istream& in, unsigned char flags = 0); - void parse(const std::string& str, unsigned char flags = 0); + bool parse(std::istream& in, unsigned char flags = 0); + bool parse(const std::string& str, unsigned char flags = 0); void reduce(); amount_t reduced() const { -- cgit v1.2.3