diff options
Diffstat (limited to 'src/session.h')
-rw-r--r-- | src/session.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/session.h b/src/session.h index 3916b964..b8fd52f2 100644 --- a/src/session.h +++ b/src/session.h @@ -42,7 +42,6 @@ #ifndef _SESSION_H #define _SESSION_H -#include "interactive.h" #include "account.h" #include "journal.h" #include "option.h" @@ -57,8 +56,7 @@ class session_t : public symbol_scope_t friend void set_session_context(session_t * session); public: - bool flush_on_next_data_file; - date_t::year_type current_year; + bool flush_on_next_data_file; std::auto_ptr<journal_t> journal; explicit session_t(); @@ -66,6 +64,10 @@ public: TRACE_DTOR(session_t); } + virtual string description() { + return _("current session"); + } + void set_flush_on_next_data_file(const bool truth) { flush_on_next_data_file = truth; } @@ -75,6 +77,13 @@ public: void read_journal_files(); void close_journal_files(); + 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_lot_price(call_scope_t& scope); + value_t fn_lot_date(call_scope_t& scope); + value_t fn_lot_tag(call_scope_t& scope); + void report_options(std::ostream& out) { HANDLER(cache_).report(out); @@ -91,7 +100,7 @@ public: option_t<session_t> * lookup_option(const char * p); virtual expr_t::ptr_op_t lookup(const symbol_t::kind_t kind, - const string& name); + const string& name); /** * Option handlers @@ -108,7 +117,7 @@ public: (session_t, price_exp_, // -Z CTOR(session_t, price_exp_) { value = 24L * 3600L; } DO_(args) { - value = args[1].to_long() * 60L; + value = args.get<long>(1) * 60L; }); OPTION__ @@ -121,13 +130,13 @@ public: data_files.clear(); parent->flush_on_next_data_file = false; } - data_files.push_back(args[1].as_string()); + data_files.push_back(args.get<string>(1)); }); 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[1].as_string().c_str()); + set_input_date_format(args.get<string>(1).c_str()); }); OPTION(session_t, master_account_); |