Loading...
Searching...
No Matches
ledger::session_t Class Reference

#include <session.h>

+ Inheritance diagram for ledger::session_t:
+ Collaboration diagram for ledger::session_t:

Classes

struct  check_payeesoption_t
 Option handlers. More...
 
struct  day_breakoption_t
 
struct  decimal_commaoption_t
 
struct  downloadoption_t
 
struct  explicitoption_t
 
struct  file_option_t
 
struct  hashes_option_t
 
struct  input_date_format_option_t
 
struct  master_account_option_t
 
struct  no_aliasesoption_t
 
struct  pedanticoption_t
 
struct  permissiveoption_t
 
struct  price_db_option_t
 
struct  price_exp_option_t
 
struct  recursive_aliasesoption_t
 
struct  strictoption_t
 
struct  time_colonoption_t
 
struct  value_expr_option_t
 

Public Member Functions

void close_journal_files ()
 
virtual void define (const symbol_t::kind_t kind, const string &name, expr_t::ptr_op_t def)
 
virtual string description ()
 
value_t fn_account (call_scope_t &scope)
 
value_t fn_int (call_scope_t &scope)
 
value_t fn_lot_date (call_scope_t &scope)
 
value_t fn_lot_price (call_scope_t &scope)
 
value_t fn_lot_tag (call_scope_t &scope)
 
value_t fn_max (call_scope_t &scope)
 
value_t fn_min (call_scope_t &scope)
 
value_t fn_str (call_scope_t &scope)
 
journal_tget_journal ()
 
virtual expr_t::ptr_op_t lookup (const symbol_t::kind_t kind, const string &name)
 
option_t< session_t > * lookup_option (const char *p)
 
std::size_t read_data (const string &master_account="")
 
journal_tread_journal (const path &pathname)
 
journal_tread_journal_files ()
 
journal_tread_journal_from_string (const string &data)
 
void report_options (std::ostream &out)
 
 session_t ()
 
void set_flush_on_next_data_file (const bool truth)
 
virtual value_t::type_t type_context () const
 
virtual bool type_required () const
 
virtual ~session_t ()
 

Public Attributes

ledger::session_t::check_payeesoption_t check_payeeshandler
 
ledger::session_t::day_breakoption_t day_breakhandler
 
ledger::session_t::decimal_commaoption_t decimal_commahandler
 
ledger::session_t::downloadoption_t downloadhandler
 
ledger::session_t::explicitoption_t explicithandler
 
ledger::session_t::file_option_t file_handler
 
bool flush_on_next_data_file
 
ledger::session_t::hashes_option_t hashes_handler
 
ledger::session_t::input_date_format_option_t input_date_format_handler
 
unique_ptr< journal_tjournal
 
ledger::session_t::master_account_option_t master_account_handler
 
ledger::session_t::no_aliasesoption_t no_aliaseshandler
 
scope_tparent
 
parse_context_stack_t parsing_context
 
ledger::session_t::pedanticoption_t pedantichandler
 
ledger::session_t::permissiveoption_t permissivehandler
 
ledger::session_t::price_db_option_t price_db_handler
 
ledger::session_t::price_exp_option_t price_exp_handler
 
ledger::session_t::recursive_aliasesoption_t recursive_aliaseshandler
 
ledger::session_t::strictoption_t stricthandler
 
ledger::session_t::time_colonoption_t time_colonhandler
 
optional< expr_tvalue_expr
 
ledger::session_t::value_expr_option_t value_expr_handler
 

Static Public Attributes

static scope_tdefault_scope
 
static empty_scope_tempty_scope
 

Friends

void set_session_context (session_t *session)
 Set the current session context, transferring all static globals to point at the data structures related to this session.
 

Detailed Description

Definition at line 64 of file session.h.

Constructor & Destructor Documentation

◆ session_t()

ledger::session_t::session_t ( )
explicit

◆ ~session_t()

virtual ledger::session_t::~session_t ( )
inlinevirtual

Definition at line 76 of file session.h.

References parsing_context, ledger::parse_context_stack_t::pop(), and TRACE_DTOR.

+ Here is the call graph for this function:

Member Function Documentation

◆ close_journal_files()

void ledger::session_t::close_journal_files ( )

◆ define()

virtual void ledger::symbol_scope_t::define ( const symbol_t::kind_t kind,
const string & name,
expr_t::ptr_op_t def )
virtualinherited

Reimplemented from ledger::child_scope_t.

◆ description()

virtual string ledger::session_t::description ( )
inlinevirtual

Reimplemented from ledger::symbol_scope_t.

Definition at line 81 of file session.h.

References ledger::downcast().

+ Here is the call graph for this function:

◆ fn_account()

value_t ledger::session_t::fn_account ( call_scope_t & scope)

◆ fn_int()

value_t ledger::session_t::fn_int ( call_scope_t & scope)

◆ fn_lot_date()

value_t ledger::session_t::fn_lot_date ( call_scope_t & scope)

◆ fn_lot_price()

value_t ledger::session_t::fn_lot_price ( call_scope_t & scope)

◆ fn_lot_tag()

value_t ledger::session_t::fn_lot_tag ( call_scope_t & scope)

◆ fn_max()

value_t ledger::session_t::fn_max ( call_scope_t & scope)

◆ fn_min()

value_t ledger::session_t::fn_min ( call_scope_t & scope)

◆ fn_str()

value_t ledger::session_t::fn_str ( call_scope_t & scope)

◆ get_journal()

journal_t * ledger::session_t::get_journal ( )

◆ lookup()

virtual expr_t::ptr_op_t ledger::session_t::lookup ( const symbol_t::kind_t kind,
const string & name )
virtual

Reimplemented from ledger::symbol_scope_t.

◆ lookup_option()

option_t< session_t > * ledger::session_t::lookup_option ( const char * p)

◆ read_data()

std::size_t ledger::session_t::read_data ( const string & master_account = "")

◆ read_journal()

journal_t * ledger::session_t::read_journal ( const path & pathname)

◆ read_journal_files()

journal_t * ledger::session_t::read_journal_files ( )

◆ read_journal_from_string()

journal_t * ledger::session_t::read_journal_from_string ( const string & data)

◆ report_options()

void ledger::session_t::report_options ( std::ostream & out)
inline

Definition at line 107 of file session.h.

References ledger::downcast(), and HANDLER.

+ Here is the call graph for this function:

◆ set_flush_on_next_data_file()

void ledger::session_t::set_flush_on_next_data_file ( const bool truth)
inline

Definition at line 85 of file session.h.

References ledger::downcast(), and flush_on_next_data_file.

+ Here is the call graph for this function:

◆ type_context()

virtual value_t::type_t ledger::scope_t::type_context ( ) const
inlinevirtualinherited

Reimplemented in ledger::context_scope_t.

Definition at line 109 of file scope.h.

References ledger::value_t::VOID.

◆ type_required()

virtual bool ledger::scope_t::type_required ( ) const
inlinevirtualinherited

Reimplemented in ledger::context_scope_t.

Definition at line 112 of file scope.h.

Friends And Related Symbol Documentation

◆ set_session_context

void set_session_context ( session_t * session)
friend

Set the current session context, transferring all static globals to point at the data structures related to this session.

Although Ledger itself is not thread-safe, by locking, switching session context, then unlocking after an operation is done, multiple threads can sequentially make use of the library. Thus, a session_t maintains all of the information relating to a single usage of the Ledger library.

Member Data Documentation

◆ check_payeeshandler

ledger::session_t::check_payeesoption_t ledger::session_t::check_payeeshandler

◆ day_breakhandler

ledger::session_t::day_breakoption_t ledger::session_t::day_breakhandler

◆ decimal_commahandler

ledger::session_t::decimal_commaoption_t ledger::session_t::decimal_commahandler

◆ default_scope

scope_t* ledger::scope_t::default_scope
staticinherited

◆ downloadhandler

ledger::session_t::downloadoption_t ledger::session_t::downloadhandler

◆ empty_scope

empty_scope_t* ledger::scope_t::empty_scope
staticinherited

Definition at line 93 of file scope.h.

◆ explicithandler

ledger::session_t::explicitoption_t ledger::session_t::explicithandler

◆ file_handler

ledger::session_t::file_option_t ledger::session_t::file_handler

◆ flush_on_next_data_file

bool ledger::session_t::flush_on_next_data_file

Definition at line 69 of file session.h.

Referenced by set_flush_on_next_data_file().

◆ hashes_handler

ledger::session_t::hashes_option_t ledger::session_t::hashes_handler

◆ input_date_format_handler

ledger::session_t::input_date_format_option_t ledger::session_t::input_date_format_handler

◆ journal

unique_ptr<journal_t> ledger::session_t::journal

Definition at line 71 of file session.h.

◆ master_account_handler

ledger::session_t::master_account_option_t ledger::session_t::master_account_handler

◆ no_aliaseshandler

ledger::session_t::no_aliasesoption_t ledger::session_t::no_aliaseshandler

◆ parent

◆ parsing_context

parse_context_stack_t ledger::session_t::parsing_context

Definition at line 72 of file session.h.

Referenced by ~session_t().

◆ pedantichandler

ledger::session_t::pedanticoption_t ledger::session_t::pedantichandler

◆ permissivehandler

ledger::session_t::permissiveoption_t ledger::session_t::permissivehandler

◆ price_db_handler

ledger::session_t::price_db_option_t ledger::session_t::price_db_handler

◆ price_exp_handler

ledger::session_t::price_exp_option_t ledger::session_t::price_exp_handler

◆ recursive_aliaseshandler

ledger::session_t::recursive_aliasesoption_t ledger::session_t::recursive_aliaseshandler

◆ stricthandler

ledger::session_t::strictoption_t ledger::session_t::stricthandler

◆ time_colonhandler

ledger::session_t::time_colonoption_t ledger::session_t::time_colonhandler

◆ value_expr

optional<expr_t> ledger::session_t::value_expr

Definition at line 73 of file session.h.

◆ value_expr_handler

ledger::session_t::value_expr_option_t ledger::session_t::value_expr_handler

The documentation for this class was generated from the following file: