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  related_posts
 
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_tparse_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  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)
 
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)
 
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)
 
charnext_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)
 
charskip_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)
 
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)
 
chartrim_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
 
string empty_string
 
optional< datetime_tepoch
 
date_time::weekdays start_of_week
 
const string version
 

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

Definition at line 55 of file account.h.

◆ acct_handler_ptr

Definition at line 91 of file chain.h.

◆ auto_xacts_list

Definition at line 61 of file journal.h.

◆ 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

◆ 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

◆ 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

Definition at line 62 of file journal.h.

◆ post_handler_ptr

Definition at line 90 of file chain.h.

◆ 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

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

Definition at line 60 of file journal.h.

Enumeration Type Documentation

◆ format_type_t

Enumerator
FMT_WRITTEN 
FMT_PRINTED 
FMT_CUSTOM 

Definition at line 98 of file times.h.

◆ hash_type_t

Enumerator
NO_HASHES 
HASH_SHA512 
HASH_SHA512_Half 

Definition at line 618 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 977 of file value.h.

References downcast().

+ 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 563 of file scope.h.

◆ 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 476 of file scope.h.

References ledger::value_t::ANY.

◆ 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 581 of file utils.h.

References downcast().

Referenced by sha1sum().

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

◆ downcast()

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

Definition at line 468 of file utils.h.

References downcast().

Referenced by ledger::balance_t::abs(), ledger::flags::supports_flags< T, U >::add_flags(), ledger::flags::delegates_flags< T >::add_flags(), add_or_set_value(), as_annotated_commodity(), as_annotated_commodity(), ledger::value_t::as_any(), ledger::value_t::as_any_lval(), ledger::expr_t::op_t::as_value_lval(), ledger::balance_t::balance_t(), ledger::balance_t::balance_t(), ledger::balance_t::balance_t(), ledger::flags::basic_t< T, U >::basic_t(), ledger::flags::basic_t< T, U >::basic_t(), ledger::date_range_t::begin(), ledger::date_specifier_or_range_t::begin(), ledger::date_interval_t::begin(), ledger::bind_scope_t::bind_scope_t(), ledger::expr_base_t< ResultType >::calc(), ledger::value_t::casted(), ledger::balance_t::ceilinged(), ledger::value_t::ceilinged(), ledger::truncate_xacts::clear(), ledger::sort_xacts::clear(), ledger::anonymize_posts::clear(), ledger::calc_posts::clear(), ledger::collapse_posts::clear(), ledger::changed_value_posts::clear(), ledger::posts_as_equity::clear(), ledger::day_of_week_posts::clear(), ledger::format_posts::clear(), ledger::post_t::clear_xdata(), ledger::python::register_optional_to_python< T >::optional_from_python::construct(), ledger::call_scope_t::context(), ledger::python::register_optional_to_python< T >::optional_from_python::convertible(), ledger::item_t::copy_details(), ledger::post_t::copy_details(), ledger::collapse_posts::create_accounts(), ledger::display_filter_posts::create_accounts(), ledger::changed_value_posts::create_accounts(), ledger::interval_posts::create_accounts(), ledger::posts_as_equity::create_accounts(), ledger::item_t::date(), ledger::date_specifier_t::date_specifier_t(), ledger::child_scope_t::define(), ledger::bind_scope_t::define(), ledger::option_t< T >::desc(), ledger::global_scope_t::description(), ledger::post_t::description(), ledger::report_t::description(), ledger::empty_scope_t::description(), ledger::session_t::description(), ledger::xact_t::description(), ledger::auto_xact_t::description(), ledger::period_xact_t::description(), digest_to_hex(), downcast(), ledger::flags::supports_flags< T, U >::drop_flags(), ledger::flags::delegates_flags< T >::drop_flags(), ledger::balance_t::dump(), ledger::format_t::dump(), either_or(), ledger::date_range_t::end(), ledger::date_specifier_or_range_t::end(), ledger::date_interval_t::end(), ledger::unistring::extract(), ledger::unistring::extract_by_width(), ledger::journal_t::fileinfo_t::fileinfo_t(), ledger::unistring::find(), find_scope(), find_scope(), ledger::balance_t::floored(), ledger::value_t::floored(), ledger::format_t::format_t(), ledger::query_t::get_query(), ledger::option_t< T >::handler(), ledger::flags::supports_flags< T, U >::has_flags(), ledger::flags::delegates_flags< T >::has_flags(), ledger::item_t::id(), ledger::date_specifier_t::implied_duration(), ledger::balance_t::in_place_reduce(), ledger::balance_t::in_place_roundto(), ledger::balance_t::in_place_unreduce(), ledger::date_interval_t::inclusive_end(), ledger::xact_posts_iterator::increment(), is_eq(), is_expr(), ledger::value_t::is_type(), is_valid(), is_valid(), ledger::date_range_t::is_within(), ledger::item_t::item_t(), join_args(), justify(), ledger::child_scope_t::lookup(), ledger::bind_scope_t::lookup(), ledger::value_scope_t::lookup(), ledger::empty_scope_t::lookup(), lowered(), ledger::format_t::mark_uncompiled(), ledger::report_t::maybe_format(), ledger::flags::basic_t< T, U >::minus_flags(), ledger::balance_t::negated(), ledger::value_t::negated(), ledger::expr_t::op_t::new_node(), next_element(), ledger::balance_t::number(), ledger::option_t< T >::off(), ledger::option_t< T >::on(), open_for_reading(), ledger::reporter< Type, handler_ptr, report_method >::operator()(), ledger::commodity_compare::operator()(), ledger::ComparePaths::operator()(), ledger::collect_posts::operator()(), ledger::push_to_posts_list::operator()(), ledger::sort_posts::operator()(), ledger::sort_xacts::operator()(), ledger::filter_posts::operator()(), ledger::related_posts::operator()(), ledger::day_of_week_posts::operator()(), ledger::item_handler< T >::operator()(), ledger::balance_t::operator*=(), ledger::balance_t::operator*=(), ledger::balance_t::operator*=(), ledger::balance_t::operator+=(), ledger::balance_t::operator+=(), ledger::balance_t::operator+=(), ledger::balance_t::operator-=(), ledger::balance_t::operator-=(), ledger::balance_t::operator-=(), ledger::balance_t::operator/=(), ledger::balance_t::operator/=(), ledger::balance_t::operator/=(), ledger::date_interval_t::operator<(), ledger::mask_t::operator<(), ledger::symbol_t::operator<(), ledger::value_t::operator<(), operator<<(), operator<<(), operator<<(), operator<<(), ledger::balance_t::operator=(), ledger::balance_t::operator=(), ledger::flags::basic_t< T, U >::operator=(), ledger::date_traits_t::operator=(), ledger::expr_base_t< ResultType >::operator=(), ledger::expr_base_t< ResultType >::operator=(), ledger::flags::supports_flags< T, U >::operator=(), ledger::flags::basic_t< T, U >::operator=(), ledger::expr_t::token_t::operator=(), ledger::query_t::lexer_t::token_t::operator=(), ledger::value_t::operator=(), ledger::balance_t::operator==(), ledger::balance_t::operator==(), ledger::commodity_t::operator==(), ledger::date_interval_t::operator==(), ledger::date_traits_t::operator==(), ledger::mask_t::operator==(), ledger::price_point_t::operator==(), ledger::symbol_t::operator==(), ledger::value_t::operator==(), ledger::balance_t::operator==(), ledger::value_t::operator>(), ledger::value_t::operator[](), ledger::value_t::operator[](), ledger::query_t::parser_t::parse(), ledger::expr_base_t< ResultType >::parse(), ledger::expr_base_t< ResultType >::parse(), ledger::query_t::parse_args(), ledger::format_t::parse_format(), ledger::commodity_t::parse_symbol(), ledger::auto_xact_t::parse_tags(), ledger::pass_down_accounts< Iterator >::pass_down_accounts(), ledger::pass_down_posts< Iterator >::pass_down_posts(), peek_next_nonws(), ledger::query_t::lexer_t::peek_token(), ledger::flags::basic_t< T, U >::plus_flags(), ledger::value_t::pop_back(), ledger::post_splitter::post_splitter(), ledger::post_t::post_t(), ledger::expr_base_t< ResultType >::preview(), ledger::ptristream::ptristream(), ledger::parse_context_stack_t::push(), ledger::parse_context_stack_t::push(), ledger::call_scope_t::push_back(), ledger::value_t::push_back(), ledger::call_scope_t::push_front(), ledger::value_t::push_front(), ledger::query_t::lexer_t::push_token(), put_date(), put_datetime(), put_mask(), ledger::query_t::query_t(), ledger::balance_t::reduced(), ledger::value_t::reduced(), ledger::python::register_python_conversion< T, TtoPy, TfromPy >::register_python_conversion(), ledger::report_t::report_format(), ledger::report_t::report_options(), ledger::session_t::report_options(), ledger::post_t::reported_account(), ledger::xacts_iterator::reset(), ledger::balance_t::rounded(), ledger::value_t::rounded(), ledger::balance_t::roundto(), ledger::value_t::roundto(), scope_value(), search_scope(), ledger::item_t::seq(), ledger::value_t::set_amount(), ledger::value_t::set_any(), ledger::value_t::set_any(), ledger::call_scope_t::set_args(), ledger::value_t::set_balance(), ledger::value_t::set_boolean(), ledger::value_t::set_date(), ledger::value_t::set_datetime(), ledger::flags::supports_flags< T, U >::set_flags(), ledger::flags::delegates_flags< T >::set_flags(), ledger::session_t::set_flush_on_next_data_file(), ledger::expr_t::op_t::set_function(), ledger::commodity_t::set_graph_index(), ledger::expr_t::op_t::set_ident(), ledger::commodity_t::set_larger(), ledger::value_t::set_long(), ledger::value_t::set_mask(), ledger::value_t::set_mask(), ledger::merged_expr_t::set_merge_operator(), ledger::commodity_t::set_name(), ledger::commodity_t::set_note(), ledger::post_splitter::set_postflush_func(), ledger::commodity_t::set_precision(), ledger::post_splitter::set_preflush_func(), ledger::value_t::set_scope(), ledger::expr_t::op_t::set_scope(), ledger::value_t::set_sequence(), ledger::commodity_t::set_smaller(), ledger::item_t::set_state(), ledger::value_t::set_string(), ledger::value_t::set_string(), ledger::merged_expr_t::set_term(), ledger::expr_base_t< ResultType >::set_text(), ledger::expr_t::op_t::set_value(), sha1sum(), ledger::global_scope_t::show_version_info(), ledger::value_t::simplified(), ledger::mask_t::str(), ledger::option_t< T >::str(), ledger::python::str_to_py_unicode(), ledger::balance_t::to_amount(), ledger::date_specifier_or_range_t::to_string(), to_string(), to_string(), ledger::query_t::parser_t::tokens_remaining(), trim_ws(), ledger::balance_t::truncated(), ledger::value_t::truncated(), ledger::unistring::unistring(), ledger::balance_t::unreduced(), ledger::value_t::unreduced(), ledger::balance_t::unrounded(), ledger::value_t::unrounded(), value_context(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::value_t::value_t(), ledger::report_t::what_to_keep(), ledger::expr_t::op_t::wrap_functor(), ledger::expr_t::op_t::wrap_value(), and ledger::xacts_iterator::xacts_iterator().

+ Here is the call graph for this function:

◆ either_or()

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

Definition at line 474 of file utils.h.

References downcast().

+ Here is the call graph for this function:

◆ 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 downcast(), ledger::child_scope_t::parent, and throw_.

+ Here is the call 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 downcast(), and throw_.

+ Here is the call graph for this function:

◆ 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 )

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 )

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.

References downcast().

+ Here is the call graph for this function:

◆ 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 downcast().

+ 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.

References downcast().

+ Here is the call graph for this function:

◆ is_valid() [2/2]

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

Definition at line 56 of file times.h.

References downcast().

+ Here is the call graph for this function:

◆ 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 568 of file scope.h.

References downcast(), and 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 downcast().

+ 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 )

◆ 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.

References downcast().

+ Here is the call graph for this function:

◆ mask_value()

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

Definition at line 957 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 493 of file utils.h.

References downcast(), and 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 downcast(), 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 downcast().

+ 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 downcast().

+ 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 downcast().

+ 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 961 of file value.h.

References downcast().

+ 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 94 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 88 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 514 of file utils.h.

References downcast().

+ Here is the call graph for this function:

◆ 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 117 of file times.h.

References downcast(), 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 113 of file times.h.

References downcast(), 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 downcast().

+ 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 972 of file value.h.

References downcast().

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

+ Here is the call graph for this function:
+ 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 downcast().

+ Here is the call 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 603 of file utils.h.

References digest_to_hex(), and downcast().

+ 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 479 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)

◆ 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 949 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.

References downcast().

+ Here is the call graph for this function:

◆ to_string() [2/2]

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

Definition at line 174 of file utils.h.

References downcast().

+ Here is the call graph for this function:

◆ trim_ws()

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

Definition at line 485 of file utils.h.

References downcast(), and skip_ws().

+ Here is the call graph for this function:

◆ value_context()

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

Definition at line 966 of file value.h.

References downcast().

+ 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

◆ 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