diff options
Diffstat (limited to 'src/session.h')
-rw-r--r-- | src/session.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/session.h b/src/session.h index 879efeb6..962664ef 100644 --- a/src/session.h +++ b/src/session.h @@ -59,8 +59,9 @@ class session_t : public symbol_scope_t public: bool flush_on_next_data_file; - std::auto_ptr<journal_t> journal; - parse_context_stack_t parsing_context; + unique_ptr<journal_t> journal; + parse_context_stack_t parsing_context; + optional<expr_t> value_expr; explicit session_t(); virtual ~session_t() { @@ -86,6 +87,8 @@ public: value_t fn_account(call_scope_t& scope); value_t fn_min(call_scope_t& scope); value_t fn_max(call_scope_t& scope); + value_t fn_int(call_scope_t& scope); + value_t fn_str(call_scope_t& scope); value_t fn_lot_price(call_scope_t& scope); value_t fn_lot_date(call_scope_t& scope); value_t fn_lot_tag(call_scope_t& scope); @@ -105,6 +108,7 @@ public: HANDLER(price_db_).report(out); HANDLER(price_exp_).report(out); HANDLER(strict).report(out); + HANDLER(value_expr_).report(out); } option_t<session_t> * lookup_option(const char * p); @@ -126,28 +130,24 @@ public: OPTION__ (session_t, price_exp_, // -Z - CTOR(session_t, price_exp_) { value = 24L * 3600L; } - DO_(args) { - value = args.get<long>(1) * 60L; - }); + CTOR(session_t, price_exp_) { value = "24"; }); OPTION__ (session_t, file_, // -f std::list<path> data_files; CTOR(session_t, file_) {} - DO_(args) { - assert(args.size() == 2); + DO_(str) { if (parent->flush_on_next_data_file) { data_files.clear(); parent->flush_on_next_data_file = false; } - data_files.push_back(args.get<string>(1)); + data_files.push_back(str); }); - OPTION_(session_t, input_date_format_, DO_(args) { - // This changes static variables inside times.h, which affects the basic - // date parser. - set_input_date_format(args.get<string>(1).c_str()); + OPTION_(session_t, input_date_format_, DO_(str) { + // This changes static variables inside times.h, which affects the + // basic date parser. + set_input_date_format(str.c_str()); }); OPTION(session_t, explicit); @@ -156,6 +156,7 @@ public: OPTION(session_t, permissive); OPTION(session_t, price_db_); OPTION(session_t, strict); + OPTION(session_t, value_expr_); }; /** |