Loading...
Searching...
No Matches
ledger Namespace Reference

Namespaces

namespace  flags
namespace  python

Classes

struct  account_compare
class  account_t
class  amount_error
class  amount_t
 Encapsulate infinite-precision commoditized amounts. More...
class  annotated_commodity_t
struct  annotation_t
class  anonymize_posts
class  auto_xact_t
class  balance_error
class  balance_t
 A wrapper around amount_t allowing addition of multiple commodities. More...
class  basic_accounts_iterator
class  bind_scope_t
class  budget_posts
class  by_payee_posts
class  calc_error
class  calc_posts
class  call_scope_t
class  changed_value_posts
class  child_scope_t
class  collapse_posts
class  collect_posts
struct  commodity_compare
class  commodity_error
class  commodity_history_t
class  commodity_pool_t
class  commodity_t
class  compare_items
struct  ComparePaths
class  compile_error
class  context_scope_t
struct  cost_breakdown_t
class  csv_error
class  csv_reader
class  data_streambuffer_t
struct  date_duration_t
class  date_error
class  date_interval_t
class  date_range_t
class  date_specifier_or_range_t
class  date_specifier_t
struct  date_traits_t
class  datetime_error
class  day_of_week_posts
class  decrypted_stream_t
class  display_filter_posts
class  draft_t
class  empty_scope_t
struct  error_count
class  expr_base_t
class  expr_t
class  filter_posts
class  forecast_posts
class  format_accounts
class  format_emacs_posts
class  format_error
class  format_posts
class  format_ptree
 Brief. More...
class  format_t
class  generate_posts
class  generate_posts_iterator
class  global_scope_t
class  ignore_posts
class  inject_posts
class  interval_posts
class  item_handler
class  item_t
class  iterator_facade_base
class  journal_posts_iterator
class  journal_t
struct  keep_details_t
class  mask_t
class  merged_expr_t
class  option_error
class  option_t
class  output_stream_t
 An output stream. More...
class  parse_context_stack_t
class  parse_context_t
class  parse_error
class  pass_down_accounts
class  pass_down_posts
class  period_xact_t
struct  position_t
class  post_splitter
class  post_t
class  posts_as_equity
class  posts_commodities_iterator
class  predicate_t
struct  price_point_t
class  print_xacts
class  ptristream
class  push_to_posts_list
class  query_t
class  report_accounts
class  report_commodities
class  report_payees
class  report_t
class  report_tags
class  reporter
class  scope_t
class  session_t
class  sort_posts
struct  sort_value_t
class  sort_xacts
class  sorted_accounts_iterator
class  subtotal_posts
class  symbol_scope_t
struct  symbol_t
class  temporaries_t
class  time_log_t
class  time_xact_t
class  transfer_details
class  truncate_xacts
class  unistring
 Abstract working with UTF-32 encoded Unicode strings. More...
class  usage_error
class  value_error
class  value_scope_t
class  value_t
 Dynamic type representing various numeric types. More...
class  xact_base_t
class  xact_posts_iterator
class  xact_t
class  xacts_iterator

Typedefs

typedef std::pair< mask_t, account_t * > account_mapping_t
typedef std::list< account_mapping_taccount_mappings_t
typedef std::map< string, account_t * > accounts_map
typedef shared_ptr< item_handler< account_t > > acct_handler_ptr
typedef std::list< auto_xact_t * > auto_xacts_list
typedef std::map< string, xact_t * > checksum_map_t
typedef gregorian::date date
typedef gregorian::date_duration date_duration
typedef boost::gregorian::date_iterator date_iterator_t
typedef boost::gregorian::date date_t
typedef boost::posix_time::ptime datetime_t
typedef std::map< string, posts_listdeferred_posts_map_t
typedef boost::filesystem::filesystem_error filesystem_error
typedef boost::filesystem::ifstream ifstream
typedef boost::filesystem::ofstream ofstream
typedef flags::basic_t< parse_flags_enum_t, uint_least8_t > parse_flags_t
typedef boost::filesystem::path path
typedef std::pair< mask_t, stringpayee_alias_mapping_t
typedef std::list< payee_alias_mapping_tpayee_alias_mappings_t
typedef std::pair< string, stringpayee_uuid_mapping_t
typedef std::list< payee_uuid_mapping_tpayee_uuid_mappings_t
typedef std::list< period_xact_t * > period_xacts_list
typedef shared_ptr< item_handler< post_t > > post_handler_ptr
typedef std::list< post_t * > posts_list
typedef std::map< datetime_t, amount_tprice_map_t
typedef posix_time::ptime ptime
typedef posix_time::seconds seconds
typedef std::string string
typedef std::list< stringstrings_list
typedef std::multimap< string, expr_t::check_expr_pairtag_check_exprs_map
typedef ptime::time_duration_type time_duration
typedef datetime_t::time_duration_type time_duration_t
typedef std::list< xact_t * > xacts_list

Enumerations

enum  format_type_t { FMT_WRITTEN , FMT_PRINTED , FMT_CUSTOM }
enum  hash_type_t { NO_HASHES = 0 , HASH_SHA512 = 1 , HASH_SHA512_Half = 2 }
enum  log_level_t {
  LOG_OFF = 0 , LOG_CRIT , LOG_FATAL , LOG_ASSERT ,
  LOG_ERROR , LOG_VERIFY , LOG_WARN , LOG_INFO ,
  LOG_EXCEPT , LOG_DEBUG , LOG_TRACE , LOG_ALL
}
enum  parse_flags_enum_t {
  PARSE_DEFAULT = 0x00 , PARSE_PARTIAL = 0x01 , PARSE_SINGLE = 0x02 , PARSE_NO_MIGRATE = 0x04 ,
  PARSE_NO_REDUCE = 0x08 , PARSE_NO_ASSIGN = 0x10 , PARSE_NO_ANNOT = 0x20 , PARSE_OP_CONTEXT = 0x40 ,
  PARSE_SOFT_FAIL = 0x80
}

Functions

template<typename T>
value_tadd_or_set_value (value_t &lhs, const T &rhs)
annotated_commodity_tas_annotated_commodity (commodity_t &commodity)
const annotated_commodity_tas_annotated_commodity (const commodity_t &commodity)
expr_t::ptr_op_t as_expr (const value_t &val)
balance_t average_lot_prices (const balance_t &bal)
sort_value_t calc_sort_value (const expr_t::ptr_op_t op)
template<>
expr_t::ptr_op_t call_scope_t::get< expr_t::ptr_op_t > (std::size_t index, bool)
template<>
bool call_scope_t::has< expr_t::ptr_op_t > (std::size_t index)
post_handler_ptr chain_handlers (post_handler_ptr handler, report_t &report, bool for_accounts_report=false)
post_handler_ptr chain_post_handlers (post_handler_ptr base_handler, report_t &report, bool for_accounts_report=false)
post_handler_ptr chain_pre_post_handlers (post_handler_ptr base_handler, report_t &report)
optional< price_point_tcommodity_quote_from_script (commodity_t &commodity, const commodity_t *exchange_commodity)
value_t convert_command (call_scope_t &scope)
void debug_assert (const string &reason, const string &func, const string &file, std::size_t line)
string digest_to_hex (const boost::uuids::detail::sha1::digest_type &message_digest, size_t len=sizeof(boost::uuids::detail::sha1::digest_type) *2)
template<typename T, typename U>
T & downcast (U &object)
const stringeither_or (const string &first, const string &second)
string error_context ()
value_t eval_command (call_scope_t &args)
value_t expr_value (expr_t::ptr_op_t op)
void extend_post (post_t &post, journal_t &journal)
string file_context (const path &file, std::size_t line)
template<typename T>
T & find_scope (child_scope_t &scope, bool skip_this=true, bool prefer_direct_parents=false)
template<typename T>
T & find_scope (scope_t &scope, bool prefer_direct_parents=false)
void finish_timer (const char *name)
value_t format_command (call_scope_t &args)
std::string format_date (const date_t &when, const format_type_t format_type=FMT_PRINTED, const optional< const char * > &format=none)
std::string format_datetime (const datetime_t &when, const format_type_t format_type=FMT_PRINTED, const optional< const char * > &format=none)
value_t get_comment (item_t &item)
void handle_debug_options (int argc, char *argv[])
bool is_eq (const char *p, const char *n)
bool is_expr (const value_t &val)
 Dealing with expr pointers tucked into value objects.
bool is_valid (const date_t &moment)
bool is_valid (const datetime_t &moment)
string item_context (const item_t &item, const string &desc)
string join_args (call_scope_t &args)
void justify (std::ostream &out, const std::string &str, int width, bool right=false, bool redden=false)
string line_context (const string &line, const string::size_type pos=0, const string::size_type end_pos=0)
void logger_func (log_level_t level)
std::pair< xact_t *, account_t * > lookup_probable_account (const string &ident, xacts_list::reverse_iterator iter, xacts_list::reverse_iterator end, account_t *ref_account=NULL)
string lowered (const string &str)
value_t mask_value (const string &str)
int mk_wcwidth (boost::uint32_t ucs)
char * next_element (char *buf, bool variable=false)
string op_context (const expr_t::ptr_op_t op, const expr_t::ptr_op_t locus=NULL)
parse_context_t open_for_reading (const path &pathname, const path &cwd)
string operator+ (const char *left, const string &right)
std::ostream & operator<< (std::ostream &out, const account_t &account)
std::ostream & operator<< (std::ostream &out, const amount_t &amt)
std::ostream & operator<< (std::ostream &out, const annotation_t &details)
std::ostream & operator<< (std::ostream &out, const balance_t &bal)
std::ostream & operator<< (std::ostream &out, const commodity_t &comm)
std::ostream & operator<< (std::ostream &out, const date_duration_t &duration)
template<typename ResultType>
std::ostream & operator<< (std::ostream &out, const expr_base_t< ResultType > &expr)
std::ostream & operator<< (std::ostream &out, const expr_t::token_t &token)
std::ostream & operator<< (std::ostream &out, const expr_t::token_t::kind_t &kind)
std::ostream & operator<< (std::ostream &out, const mask_t &mask)
std::ostream & operator<< (std::ostream &out, const value_t &val)
std::istream & operator>> (std::istream &in, amount_t &amt)
value_t parse_command (call_scope_t &args)
date_t parse_date (const char *str)
date_t parse_date (const std::string &str)
datetime_t parse_datetime (const char *str)
datetime_t parse_datetime (const std::string &str)
int peek_next_nonws (std::istream &in)
value_t period_command (call_scope_t &args)
void print_item (std::ostream &out, const item_t &item, const string &prefix="")
strings_list process_arguments (strings_list args, scope_t &scope)
void process_environment (const char **envp, const string &tag, scope_t &scope)
bool process_option (const string &whence, const string &name, scope_t &scope, const char *arg, const string &varname)
void push_sort_value (std::list< sort_value_t > &sort_values, expr_t::ptr_op_t node, scope_t &scope)
void put_account (property_tree::ptree &pt, const account_t &acct, function< bool(const account_t &)> pred)
void put_amount (property_tree::ptree &pt, const amount_t &amt, bool commodity_details=false)
void put_annotation (property_tree::ptree &pt, const annotation_t &details)
void put_balance (property_tree::ptree &pt, const balance_t &bal)
void put_commodity (property_tree::ptree &pt, const commodity_t &comm, bool commodity_details=false)
void put_date (property_tree::ptree &pt, const date_t &when)
void put_datetime (property_tree::ptree &pt, const datetime_t &when)
void put_mask (property_tree::ptree &pt, const mask_t &mask)
void put_metadata (property_tree::ptree &pt, const item_t::string_map &metadata)
void put_post (property_tree::ptree &pt, const post_t &post)
void put_value (property_tree::ptree &pt, const value_t &value)
void put_xact (property_tree::ptree &pt, const xact_t &xact)
value_t query_command (call_scope_t &args)
value_t report_statistics (call_scope_t &scope)
path resolve_path (const path &pathname)
value_t scope_value (scope_t *val)
template<typename T>
T * search_scope (scope_t *ptr, bool prefer_direct_parents=false)
value_t select_command (call_scope_t &args)
void set_date_format (const char *format)
void set_datetime_format (const char *format)
void set_expr (value_t &val, expr_t::ptr_op_t op)
void set_input_date_format (const char *format)
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.
string sha1sum (const string &str, size_t len=sizeof(boost::uuids::detail::sha1::digest_type) *2)
void show_period_tokens (std::ostream &out, const string &arg)
char * skip_ws (char *ptr)
bool sort_value_is_less_than (const std::list< sort_value_t > &left_values, const std::list< sort_value_t > &right_values)
value_t source_command (call_scope_t &scope)
string source_context (const path &file, const std::istream::pos_type pos, const std::istream::pos_type end_pos, const string &prefix="")
strings_list split_arguments (const char *line)
value_t split_cons_expr (expr_t::ptr_op_t op)
void start_timer (const char *name, log_level_t lvl)
void stop_timer (const char *name)
optional< date_time::weekdays > string_to_day_of_week (const std::string &str)
optional< date_time::months_of_year > string_to_month_of_year (const std::string &str)
value_t string_value (const string &str="")
value_t template_command (call_scope_t &args)
template<typename T>
void throw_func (const string &message)
void times_initialize ()
void times_shutdown ()
string to_string (long num)
string to_string (std::size_t num)
char * trim_ws (char *ptr)
string value_context (const value_t &val)
void warning_func (const string &message)
value_t xact_command (call_scope_t &args)

Variables

std::ostringstream _ctxt_buffer
std::ostringstream _desc_buffer
std::string _init_file
std::ostringstream _log_buffer
log_level_t _log_level
std::ostream * _log_stream
string empty_string
optional< datetime_tepoch
date_time::weekdays start_of_week
const string version
optional< int > year_directive_year

Typedef Documentation

◆ account_mapping_t

Definition at line 67 of file journal.h.

◆ account_mappings_t

Definition at line 68 of file journal.h.

◆ accounts_map

typedef std::map< string, account_t * > ledger::accounts_map

Definition at line 55 of file account.h.

◆ acct_handler_ptr

Definition at line 91 of file chain.h.

◆ auto_xacts_list

typedef std::list< auto_xact_t * > ledger::auto_xacts_list

Definition at line 61 of file journal.h.

◆ checksum_map_t

typedef std::map<string, xact_t *> ledger::checksum_map_t

Definition at line 70 of file journal.h.

◆ date

typedef gregorian::date ledger::date

Definition at line 64 of file utils.h.

◆ date_duration

typedef gregorian::date_duration ledger::date_duration

Definition at line 65 of file utils.h.

◆ date_iterator_t

typedef boost::gregorian::date_iterator ledger::date_iterator_t

Definition at line 61 of file times.h.

◆ date_t

typedef boost::gregorian::date ledger::date_t

Definition at line 60 of file times.h.

◆ datetime_t

typedef boost::posix_time::ptime ledger::datetime_t

Definition at line 53 of file times.h.

◆ deferred_posts_map_t

Definition at line 56 of file account.h.

◆ filesystem_error

typedef boost::filesystem::filesystem_error ledger::filesystem_error

Definition at line 71 of file utils.h.

◆ ifstream

typedef boost::filesystem::ifstream ledger::ifstream

Definition at line 69 of file utils.h.

◆ ofstream

typedef boost::filesystem::ofstream ledger::ofstream

Definition at line 70 of file utils.h.

◆ parse_flags_t

Definition at line 79 of file amount.h.

◆ path

typedef boost::filesystem::path ledger::path

Definition at line 68 of file utils.h.

◆ payee_alias_mapping_t

Definition at line 63 of file journal.h.

◆ payee_alias_mappings_t

Definition at line 64 of file journal.h.

◆ payee_uuid_mapping_t

Definition at line 65 of file journal.h.

◆ payee_uuid_mappings_t

Definition at line 66 of file journal.h.

◆ period_xacts_list

typedef std::list< period_xact_t * > ledger::period_xacts_list

Definition at line 62 of file journal.h.

◆ post_handler_ptr

Definition at line 90 of file chain.h.

◆ posts_list

typedef std::list< post_t * > ledger::posts_list

Definition at line 54 of file account.h.

◆ price_map_t

Definition at line 53 of file history.h.

◆ ptime

typedef posix_time::ptime ledger::ptime

Definition at line 62 of file utils.h.

◆ seconds

typedef posix_time::seconds ledger::seconds

Definition at line 66 of file utils.h.

◆ string

typedef std::string ledger::string

Definition at line 59 of file utils.h.

◆ strings_list

typedef std::list<string> ledger::strings_list

Definition at line 60 of file utils.h.

◆ tag_check_exprs_map

Definition at line 72 of file journal.h.

◆ time_duration

typedef ptime::time_duration_type ledger::time_duration

Definition at line 63 of file utils.h.

◆ time_duration_t

typedef datetime_t::time_duration_type ledger::time_duration_t

Definition at line 54 of file times.h.

◆ xacts_list

typedef std::list< xact_t * > ledger::xacts_list

Definition at line 60 of file journal.h.

Enumeration Type Documentation

◆ format_type_t

Enumerator
FMT_WRITTEN 
FMT_PRINTED 
FMT_CUSTOM 

Definition at line 99 of file times.h.

◆ hash_type_t

Enumerator
NO_HASHES 
HASH_SHA512 
HASH_SHA512_Half 

Definition at line 592 of file utils.h.

◆ log_level_t

Enumerator
LOG_OFF 
LOG_CRIT 
LOG_FATAL 
LOG_ASSERT 
LOG_ERROR 
LOG_VERIFY 
LOG_WARN 
LOG_INFO 
LOG_EXCEPT 
LOG_DEBUG 
LOG_TRACE 
LOG_ALL 

Definition at line 201 of file utils.h.

◆ parse_flags_enum_t

Enumerator
PARSE_DEFAULT 
PARSE_PARTIAL 
PARSE_SINGLE 
PARSE_NO_MIGRATE 
PARSE_NO_REDUCE 
PARSE_NO_ASSIGN 
PARSE_NO_ANNOT 
PARSE_OP_CONTEXT 
PARSE_SOFT_FAIL 

Definition at line 67 of file amount.h.

Function Documentation

◆ add_or_set_value()

template<typename T>
value_t & ledger::add_or_set_value ( value_t & lhs,
const T & rhs )
inline

Definition at line 996 of file value.h.

References ledger::value_t::is_null().

Here is the call graph for this function:

◆ as_annotated_commodity() [1/2]

annotated_commodity_t & ledger::as_annotated_commodity ( commodity_t & commodity)
inline

Definition at line 225 of file annotate.h.

References downcast().

Here is the call graph for this function:

◆ as_annotated_commodity() [2/2]

const annotated_commodity_t & ledger::as_annotated_commodity ( const commodity_t & commodity)
inline

Definition at line 229 of file annotate.h.

References downcast().

Here is the call graph for this function:

◆ as_expr()

expr_t::ptr_op_t ledger::as_expr ( const value_t & val)

◆ average_lot_prices()

balance_t ledger::average_lot_prices ( const balance_t & bal)

Referenced by ledger::report_t::report_options().

Here is the caller graph for this function:

◆ calc_sort_value()

sort_value_t ledger::calc_sort_value ( const expr_t::ptr_op_t op)

◆ call_scope_t::get< expr_t::ptr_op_t >()

template<>
expr_t::ptr_op_t ledger::call_scope_t::get< expr_t::ptr_op_t > ( std::size_t index,
bool  )
inline

Definition at line 561 of file scope.h.

References ledger::call_scope_t::get().

Here is the call graph for this function:

◆ call_scope_t::has< expr_t::ptr_op_t >()

template<>
bool ledger::call_scope_t::has< expr_t::ptr_op_t > ( std::size_t index)
inline

Definition at line 474 of file scope.h.

References ledger::value_t::ANY, and ledger::call_scope_t::has().

Here is the call graph for this function:

◆ chain_handlers()

post_handler_ptr ledger::chain_handlers ( post_handler_ptr handler,
report_t & report,
bool for_accounts_report = false )
inline

Definition at line 105 of file chain.h.

References chain_post_handlers(), and chain_pre_post_handlers().

Here is the call graph for this function:

◆ chain_post_handlers()

post_handler_ptr ledger::chain_post_handlers ( post_handler_ptr base_handler,
report_t & report,
bool for_accounts_report = false )

Referenced by chain_handlers().

Here is the caller graph for this function:

◆ chain_pre_post_handlers()

post_handler_ptr ledger::chain_pre_post_handlers ( post_handler_ptr base_handler,
report_t & report )

Referenced by chain_handlers().

Here is the caller graph for this function:

◆ commodity_quote_from_script()

optional< price_point_t > ledger::commodity_quote_from_script ( commodity_t & commodity,
const commodity_t * exchange_commodity )

◆ convert_command()

value_t ledger::convert_command ( call_scope_t & scope)

◆ debug_assert()

void ledger::debug_assert ( const string & reason,
const string & func,
const string & file,
std::size_t line )

◆ digest_to_hex()

string ledger::digest_to_hex ( const boost::uuids::detail::sha1::digest_type & message_digest,
size_t len = sizeof(boost::uuids::detail::sha1::digest_type) * 2 )
inline

Definition at line 555 of file utils.h.

Referenced by sha1sum().

Here is the caller graph for this function:

◆ downcast()

template<typename T, typename U>
T & ledger::downcast ( U & object)
inline

Definition at line 442 of file utils.h.

Referenced by as_annotated_commodity(), and as_annotated_commodity().

Here is the caller graph for this function:

◆ either_or()

const string & ledger::either_or ( const string & first,
const string & second )
inline

Definition at line 448 of file utils.h.

◆ error_context()

string ledger::error_context ( )

◆ eval_command()

value_t ledger::eval_command ( call_scope_t & args)

◆ expr_value()

value_t ledger::expr_value ( expr_t::ptr_op_t op)

◆ extend_post()

void ledger::extend_post ( post_t & post,
journal_t & journal )

◆ file_context()

string ledger::file_context ( const path & file,
std::size_t line )

Referenced by ledger::parse_context_t::location().

Here is the caller graph for this function:

◆ find_scope() [1/2]

template<typename T>
T & ledger::find_scope ( child_scope_t & scope,
bool skip_this = true,
bool prefer_direct_parents = false )
inline

Definition at line 222 of file scope.h.

References ledger::child_scope_t::parent, search_scope(), and throw_.

Referenced by ledger::call_scope_t::context().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_scope() [2/2]

template<typename T>
T & ledger::find_scope ( scope_t & scope,
bool prefer_direct_parents = false )
inline

Definition at line 234 of file scope.h.

References search_scope(), and throw_.

Here is the call graph for this function:

◆ finish_timer()

void ledger::finish_timer ( const char * name)

◆ format_command()

value_t ledger::format_command ( call_scope_t & args)

◆ format_date()

std::string ledger::format_date ( const date_t & when,
const format_type_t format_type = FMT_PRINTED,
const optional< const char * > & format = none )

References FMT_PRINTED.

Referenced by put_date().

Here is the caller graph for this function:

◆ format_datetime()

std::string ledger::format_datetime ( const datetime_t & when,
const format_type_t format_type = FMT_PRINTED,
const optional< const char * > & format = none )

References FMT_PRINTED.

Referenced by put_datetime().

Here is the caller graph for this function:

◆ get_comment()

value_t ledger::get_comment ( item_t & item)

◆ handle_debug_options()

void ledger::handle_debug_options ( int argc,
char * argv[] )

◆ is_eq()

bool ledger::is_eq ( const char * p,
const char * n )
inline

Definition at line 232 of file option.h.

◆ is_expr()

bool ledger::is_expr ( const value_t & val)
inline

Dealing with expr pointers tucked into value objects.

Definition at line 113 of file expr.h.

References ledger::value_t::as_any(), and ledger::value_t::is_any().

Here is the call graph for this function:

◆ is_valid() [1/2]

bool ledger::is_valid ( const date_t & moment)
inline

Definition at line 63 of file times.h.

◆ is_valid() [2/2]

bool ledger::is_valid ( const datetime_t & moment)
inline

Definition at line 56 of file times.h.

◆ item_context()

string ledger::item_context ( const item_t & item,
const string & desc )

Referenced by ledger::pass_down_posts< Iterator >::pass_down_posts().

Here is the caller graph for this function:

◆ join_args()

string ledger::join_args ( call_scope_t & args)
inline

Definition at line 566 of file scope.h.

References ledger::call_scope_t::size().

Here is the call graph for this function:

◆ justify()

void ledger::justify ( std::ostream & out,
const std::string & str,
int width,
bool right = false,
bool redden = false )
inline

Definition at line 180 of file unistring.h.

References ledger::unistring::width().

Here is the call graph for this function:

◆ line_context()

string ledger::line_context ( const string & line,
const string::size_type pos = 0,
const string::size_type end_pos = 0 )

◆ logger_func()

void ledger::logger_func ( log_level_t level)

◆ lookup_probable_account()

std::pair< xact_t *, account_t * > ledger::lookup_probable_account ( const string & ident,
xacts_list::reverse_iterator iter,
xacts_list::reverse_iterator end,
account_t * ref_account = NULL )

◆ lowered()

string ledger::lowered ( const string & str)
inline

Definition at line 180 of file utils.h.

◆ mask_value()

value_t ledger::mask_value ( const string & str)
inline

Definition at line 976 of file value.h.

◆ mk_wcwidth()

int ledger::mk_wcwidth ( boost::uint32_t ucs)

Referenced by ledger::unistring::extract_by_width(), and ledger::unistring::width().

Here is the caller graph for this function:

◆ next_element()

char * ledger::next_element ( char * buf,
bool variable = false )
inline

Definition at line 467 of file utils.h.

References skip_ws().

Here is the call graph for this function:

◆ op_context()

string ledger::op_context ( const expr_t::ptr_op_t op,
const expr_t::ptr_op_t locus = NULL )

◆ open_for_reading()

parse_context_t ledger::open_for_reading ( const path & pathname,
const path & cwd )
inline

Definition at line 115 of file context.h.

References ledger::decrypted_stream_t::open_stream(), ledger::parse_context_t::pathname, resolve_path(), and throw_.

Referenced by ledger::parse_context_stack_t::push().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+()

string ledger::operator+ ( const char * left,
const string & right )
inline

Definition at line 186 of file utils.h.

◆ operator<<() [1/11]

std::ostream & ledger::operator<< ( std::ostream & out,
const account_t & account )

◆ operator<<() [2/11]

std::ostream & ledger::operator<< ( std::ostream & out,
const amount_t & amt )
inline

Definition at line 772 of file amount.h.

References ledger::amount_t::print(), ledger::amount_t::stream_fullstrings, and ledger::amount_t::unrounded().

Here is the call graph for this function:

◆ operator<<() [3/11]

std::ostream & ledger::operator<< ( std::ostream & out,
const annotation_t & details )
inline

Definition at line 151 of file annotate.h.

References ledger::annotation_t::print().

Here is the call graph for this function:

◆ operator<<() [4/11]

std::ostream & ledger::operator<< ( std::ostream & out,
const balance_t & bal )
inline

Definition at line 601 of file balance.h.

References ledger::balance_t::print().

Here is the call graph for this function:

◆ operator<<() [5/11]

std::ostream & ledger::operator<< ( std::ostream & out,
const commodity_t & comm )
inline

Definition at line 285 of file commodity.h.

References ledger::commodity_t::print().

Here is the call graph for this function:

◆ operator<<() [6/11]

std::ostream & ledger::operator<< ( std::ostream & out,
const date_duration_t & duration )

◆ operator<<() [7/11]

template<typename ResultType>
std::ostream & ledger::operator<< ( std::ostream & out,
const expr_base_t< ResultType > & expr )

Definition at line 236 of file exprbase.h.

References ledger::expr_base_t< ResultType >::print().

Here is the call graph for this function:

◆ operator<<() [8/11]

std::ostream & ledger::operator<< ( std::ostream & out,
const expr_t::token_t & token )

◆ operator<<() [9/11]

std::ostream & ledger::operator<< ( std::ostream & out,
const expr_t::token_t::kind_t & kind )

◆ operator<<() [10/11]

std::ostream & ledger::operator<< ( std::ostream & out,
const mask_t & mask )
inline

Definition at line 128 of file mask.h.

References ledger::mask_t::str().

Here is the call graph for this function:

◆ operator<<() [11/11]

std::ostream & ledger::operator<< ( std::ostream & out,
const value_t & val )
inline

Definition at line 980 of file value.h.

References ledger::value_t::print().

Here is the call graph for this function:

◆ operator>>()

std::istream & ledger::operator>> ( std::istream & in,
amount_t & amt )
inline

Definition at line 779 of file amount.h.

References ledger::amount_t::parse().

Here is the call graph for this function:

◆ parse_command()

value_t ledger::parse_command ( call_scope_t & args)

◆ parse_date() [1/2]

date_t ledger::parse_date ( const char * str)

Referenced by parse_date().

Here is the caller graph for this function:

◆ parse_date() [2/2]

date_t ledger::parse_date ( const std::string & str)
inline

Definition at line 95 of file times.h.

References parse_date().

Here is the call graph for this function:

◆ parse_datetime() [1/2]

datetime_t ledger::parse_datetime ( const char * str)

Referenced by parse_datetime().

Here is the caller graph for this function:

◆ parse_datetime() [2/2]

datetime_t ledger::parse_datetime ( const std::string & str)
inline

Definition at line 89 of file times.h.

References parse_datetime().

Here is the call graph for this function:

◆ peek_next_nonws()

int ledger::peek_next_nonws ( std::istream & in)
inline

Definition at line 488 of file utils.h.

◆ period_command()

value_t ledger::period_command ( call_scope_t & args)

◆ print_item()

void ledger::print_item ( std::ostream & out,
const item_t & item,
const string & prefix = "" )

◆ process_arguments()

strings_list ledger::process_arguments ( strings_list args,
scope_t & scope )

◆ process_environment()

void ledger::process_environment ( const char ** envp,
const string & tag,
scope_t & scope )

◆ process_option()

bool ledger::process_option ( const string & whence,
const string & name,
scope_t & scope,
const char * arg,
const string & varname )

◆ push_sort_value()

void ledger::push_sort_value ( std::list< sort_value_t > & sort_values,
expr_t::ptr_op_t node,
scope_t & scope )

◆ put_account()

void ledger::put_account ( property_tree::ptree & pt,
const account_t & acct,
function< bool(const account_t &)> pred )

◆ put_amount()

void ledger::put_amount ( property_tree::ptree & pt,
const amount_t & amt,
bool commodity_details = false )

◆ put_annotation()

void ledger::put_annotation ( property_tree::ptree & pt,
const annotation_t & details )

◆ put_balance()

void ledger::put_balance ( property_tree::ptree & pt,
const balance_t & bal )

◆ put_commodity()

void ledger::put_commodity ( property_tree::ptree & pt,
const commodity_t & comm,
bool commodity_details = false )

◆ put_date()

void ledger::put_date ( property_tree::ptree & pt,
const date_t & when )
inline

Definition at line 118 of file times.h.

References FMT_WRITTEN, and format_date().

Here is the call graph for this function:

◆ put_datetime()

void ledger::put_datetime ( property_tree::ptree & pt,
const datetime_t & when )
inline

Definition at line 114 of file times.h.

References FMT_WRITTEN, and format_datetime().

Here is the call graph for this function:

◆ put_mask()

void ledger::put_mask ( property_tree::ptree & pt,
const mask_t & mask )
inline

Definition at line 133 of file mask.h.

References ledger::mask_t::str().

Here is the call graph for this function:

◆ put_metadata()

void ledger::put_metadata ( property_tree::ptree & pt,
const item_t::string_map & metadata )

◆ put_post()

void ledger::put_post ( property_tree::ptree & pt,
const post_t & post )

◆ put_value()

void ledger::put_value ( property_tree::ptree & pt,
const value_t & value )

◆ put_xact()

void ledger::put_xact ( property_tree::ptree & pt,
const xact_t & xact )

◆ query_command()

value_t ledger::query_command ( call_scope_t & args)

◆ report_statistics()

value_t ledger::report_statistics ( call_scope_t & scope)

◆ resolve_path()

path ledger::resolve_path ( const path & pathname)

Referenced by open_for_reading().

Here is the caller graph for this function:

◆ scope_value()

value_t ledger::scope_value ( scope_t * val)
inline

Definition at line 991 of file value.h.

Referenced by ledger::report_t::fn_options().

Here is the caller graph for this function:

◆ search_scope()

template<typename T>
T * ledger::search_scope ( scope_t * ptr,
bool prefer_direct_parents = false )

Definition at line 201 of file scope.h.

References DEBUG, ledger::scope_t::description(), and search_scope().

Referenced by find_scope(), find_scope(), and search_scope().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ select_command()

value_t ledger::select_command ( call_scope_t & args)

◆ set_date_format()

void ledger::set_date_format ( const char * format)

◆ set_datetime_format()

void ledger::set_datetime_format ( const char * format)

◆ set_expr()

void ledger::set_expr ( value_t & val,
expr_t::ptr_op_t op )

◆ set_input_date_format()

void ledger::set_input_date_format ( const char * format)

◆ set_session_context()

void ledger::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.

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.

◆ sha1sum()

string ledger::sha1sum ( const string & str,
size_t len = sizeof(boost::uuids::detail::sha1::digest_type) * 2 )
inline

Definition at line 577 of file utils.h.

References digest_to_hex().

Here is the call graph for this function:

◆ show_period_tokens()

void ledger::show_period_tokens ( std::ostream & out,
const string & arg )

◆ skip_ws()

char * ledger::skip_ws ( char * ptr)
inline

Definition at line 453 of file utils.h.

Referenced by next_element(), and trim_ws().

Here is the caller graph for this function:

◆ sort_value_is_less_than()

bool ledger::sort_value_is_less_than ( const std::list< sort_value_t > & left_values,
const std::list< sort_value_t > & right_values )

Referenced by ledger::compare_items< T >::operator()().

Here is the caller graph for this function:

◆ source_command()

value_t ledger::source_command ( call_scope_t & scope)

◆ source_context()

string ledger::source_context ( const path & file,
const std::istream::pos_type pos,
const std::istream::pos_type end_pos,
const string & prefix = "" )

◆ split_arguments()

strings_list ledger::split_arguments ( const char * line)

◆ split_cons_expr()

value_t ledger::split_cons_expr ( expr_t::ptr_op_t op)

◆ start_timer()

void ledger::start_timer ( const char * name,
log_level_t lvl )

◆ stop_timer()

void ledger::stop_timer ( const char * name)

◆ string_to_day_of_week()

optional< date_time::weekdays > ledger::string_to_day_of_week ( const std::string & str)

◆ string_to_month_of_year()

optional< date_time::months_of_year > ledger::string_to_month_of_year ( const std::string & str)

◆ string_value()

value_t ledger::string_value ( const string & str = "")
inline

Definition at line 968 of file value.h.

Referenced by ledger::option_t< T >::operator()(), and ledger::query_t::query_t().

Here is the caller graph for this function:

◆ template_command()

value_t ledger::template_command ( call_scope_t & args)

◆ throw_func()

template<typename T>
void ledger::throw_func ( const string & message)
inline

Definition at line 49 of file error.h.

References _desc_buffer.

◆ times_initialize()

void ledger::times_initialize ( )

◆ times_shutdown()

void ledger::times_shutdown ( )

◆ to_string() [1/2]

string ledger::to_string ( long num)
inline

Definition at line 168 of file utils.h.

◆ to_string() [2/2]

string ledger::to_string ( std::size_t num)
inline

Definition at line 174 of file utils.h.

◆ trim_ws()

char * ledger::trim_ws ( char * ptr)
inline

Definition at line 459 of file utils.h.

References skip_ws().

Here is the call graph for this function:

◆ value_context()

string ledger::value_context ( const value_t & val)
inline

Definition at line 985 of file value.h.

References ledger::value_t::print().

Here is the call graph for this function:

◆ warning_func()

void ledger::warning_func ( const string & message)
inline

Definition at line 59 of file error.h.

References _desc_buffer.

Referenced by ledger::parse_context_t::warning(), and ledger::parse_context_t::warning().

Here is the caller graph for this function:

◆ xact_command()

value_t ledger::xact_command ( call_scope_t & args)

Variable Documentation

◆ _ctxt_buffer

std::ostringstream ledger::_ctxt_buffer
extern

◆ _desc_buffer

std::ostringstream ledger::_desc_buffer
extern

Referenced by throw_func(), and warning_func().

◆ _init_file

std::string ledger::_init_file
extern

◆ _log_buffer

std::ostringstream ledger::_log_buffer
extern

◆ _log_level

log_level_t ledger::_log_level
extern

◆ _log_stream

std::ostream* ledger::_log_stream
extern

◆ empty_string

◆ epoch

optional<datetime_t> ledger::epoch
extern

◆ start_of_week

date_time::weekdays ledger::start_of_week
extern

◆ version

const string ledger::version
extern

◆ year_directive_year

optional<int> ledger::year_directive_year
extern