diff options
Diffstat (limited to 'src/session.cc')
-rw-r--r-- | src/session.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/session.cc b/src/session.cc index 3e7cdb3d..76061de7 100644 --- a/src/session.cc +++ b/src/session.cc @@ -112,6 +112,8 @@ std::size_t session_t::read_data(const string& master_account) journal->checking_style = journal_t::CHECK_ERROR; else if (HANDLED(strict)) journal->checking_style = journal_t::CHECK_WARNING; + else if (HANDLED(value_expr_)) + journal->value_expr = HANDLER(value_expr_).str(); #if defined(HAVE_BOOST_SERIALIZATION) optional<archive_t> cache; @@ -268,6 +270,15 @@ value_t session_t::fn_max(call_scope_t& args) return args[1] > args[0] ? args[1] : args[0]; } +value_t session_t::fn_int(call_scope_t& args) +{ + return args[0].to_long(); +} +value_t session_t::fn_str(call_scope_t& args) +{ + return string_value(args[0].to_string()); +} + value_t session_t::fn_lot_price(call_scope_t& args) { amount_t amt(args.get<amount_t>(1, false)); @@ -334,6 +345,9 @@ option_t<session_t> * session_t::lookup_option(const char * p) case 's': OPT(strict); break; + case 'v': + OPT(value_expr_); + break; } return NULL; } @@ -360,6 +374,11 @@ expr_t::ptr_op_t session_t::lookup(const symbol_t::kind_t kind, return MAKE_FUNCTOR(session_t::fn_lot_tag); break; + case 'i': + if (is_eq(p, "int")) + return MAKE_FUNCTOR(session_t::fn_int); + break; + case 'm': if (is_eq(p, "min")) return MAKE_FUNCTOR(session_t::fn_min); @@ -367,6 +386,11 @@ expr_t::ptr_op_t session_t::lookup(const symbol_t::kind_t kind, return MAKE_FUNCTOR(session_t::fn_max); break; + case 's': + if (is_eq(p, "str")) + return MAKE_FUNCTOR(session_t::fn_str); + break; + default: break; } |