summaryrefslogtreecommitdiff
path: root/src/amount.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-08 23:40:42 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-09 02:06:06 -0500
commitc3535d06c89732a0ba4c13274702b0f48198ae79 (patch)
tree5a8153d4c627cc3c7eff687b50a59a1cc9c3d04a /src/amount.h
parent523d4243e8c347cb7cbd1f68b03a5098ceb73b70 (diff)
downloadfork-ledger-c3535d06c89732a0ba4c13274702b0f48198ae79.tar.gz
fork-ledger-c3535d06c89732a0ba4c13274702b0f48198ae79.tar.bz2
fork-ledger-c3535d06c89732a0ba4c13274702b0f48198ae79.zip
Redesigned the expr_t, predicate_t, query_t classes
Diffstat (limited to 'src/amount.h')
-rw-r--r--src/amount.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/amount.h b/src/amount.h
index 1cbd5185..add32b03 100644
--- a/src/amount.h
+++ b/src/amount.h
@@ -66,6 +66,20 @@ class commodity_pool_t;
DECLARE_EXCEPTION(amount_error, std::runtime_error);
+enum parse_flags_enum_t {
+ PARSE_DEFAULT = 0x00,
+ PARSE_PARTIAL = 0x01,
+ PARSE_SINGLE = 0x02,
+ PARSE_NO_MIGRATE = 0x04,
+ PARSE_NO_REDUCE = 0x08,
+ PARSE_NO_ASSIGN = 0x10,
+ PARSE_NO_DATES = 0x20,
+ PARSE_OP_CONTEXT = 0x40,
+ PARSE_SOFT_FAIL = 0x80
+};
+
+typedef basic_flags_t<parse_flags_enum_t, uint_least8_t> parse_flags_t;
+
/**
* @brief Encapsulate infinite-precision commoditized amounts
*
@@ -612,17 +626,8 @@ public:
amount_t::parse_conversion("1.0m", "60s"); // a minute is 60 seconds
amount_t::parse_conversion("1.0h", "60m"); // an hour is 60 minutes
@endcode
- */
- enum parse_flags_enum_t {
- PARSE_DEFAULT = 0x00,
- PARSE_NO_MIGRATE = 0x01,
- PARSE_NO_REDUCE = 0x02,
- PARSE_SOFT_FAIL = 0x04
- };
-
- typedef basic_flags_t<parse_flags_enum_t, uint_least8_t> parse_flags_t;
- /** The method parse() is used to parse an amount from an input stream
+ The method parse() is used to parse an amount from an input stream
or a string. A global operator>>() is also defined which simply
calls parse on the input stream. The parse() method has two forms: