summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-06 03:18:10 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-03-06 03:24:06 -0600
commit97d68ebc8cf2bf88feffaedd6873934dc785c411 (patch)
treeb19e73eb8860dda1bbf8358141ddf1afc2060b50 /src/textual.cc
parenteb3591f898e194be0cb6c15107e8e41e9dd67206 (diff)
downloadfork-ledger-97d68ebc8cf2bf88feffaedd6873934dc785c411.tar.gz
fork-ledger-97d68ebc8cf2bf88feffaedd6873934dc785c411.tar.bz2
fork-ledger-97d68ebc8cf2bf88feffaedd6873934dc785c411.zip
Added "value" sub-directive for commodity directive
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/textual.cc b/src/textual.cc
index b1df1fb8..cf15f048 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -134,6 +134,7 @@ namespace {
void commodity_directive(char * line);
void commodity_alias_directive(commodity_t& comm, string alias);
+ void commodity_value_directive(commodity_t& comm, string expr_str);
void commodity_format_directive(commodity_t& comm, string format);
void commodity_nomarket_directive(commodity_t& comm);
void commodity_default_directive(commodity_t& comm);
@@ -1018,6 +1019,8 @@ void instance_t::commodity_directive(char * line)
string keyword(q);
if (keyword == "alias")
commodity_alias_directive(*commodity, b);
+ else if (keyword == "value")
+ commodity_value_directive(*commodity, b);
else if (keyword == "format")
commodity_format_directive(*commodity, b);
else if (keyword == "nomarket")
@@ -1036,6 +1039,11 @@ void instance_t::commodity_alias_directive(commodity_t& comm, string alias)
commodity_pool_t::current_pool->alias(alias, comm);
}
+void instance_t::commodity_value_directive(commodity_t& comm, string expr_str)
+{
+ comm.set_value_expr(expr_t(expr_str));
+}
+
void instance_t::commodity_format_directive(commodity_t&, string format)
{
// jww (2012-02-27): A format specified this way should turn off