teditor  1.8.0@@fee5e94
Terminal based editor written in C++
Public Member Functions | List of all members
teditor::ledger::Parser Class Reference

#include <parser.h>

Public Member Functions

 Parser (const std::string &f)
 
void reload ()
 
const Transactionstransactions () const
 
const Accountsaccounts () const
 
Accounts topAccounts (bool sort=true) const
 Computes balances of only the top-level accounts. Top-level account is the account name that preceeds the first ':' in all of the accounts in the ledger. Eg: top-level account of 'Expenses:Medical:Vaccination' is 'Expenses'. More...
 
Accounts allAccounts (bool sort=true) const
 Computes balances of the top-level accounts as well as all accounts. More...
 
void minmaxDates (TimePoint &min, TimePoint &max) const
 

Detailed Description

Poor man's ledger parser!

Constructor & Destructor Documentation

◆ Parser()

teditor::ledger::Parser::Parser ( const std::string &  f)

Member Function Documentation

◆ accounts()

const Accounts& teditor::ledger::Parser::accounts ( ) const
inline

◆ allAccounts()

Accounts teditor::ledger::Parser::allAccounts ( bool  sort = true) const

Computes balances of the top-level accounts as well as all accounts.

Parameters
sortwhether to sort the output before returning
Returns
all the accounts

◆ minmaxDates()

void teditor::ledger::Parser::minmaxDates ( TimePoint min,
TimePoint max 
) const

earliest and latest transaction dates

◆ reload()

void teditor::ledger::Parser::reload ( )

◆ topAccounts()

Accounts teditor::ledger::Parser::topAccounts ( bool  sort = true) const

Computes balances of only the top-level accounts. Top-level account is the account name that preceeds the first ':' in all of the accounts in the ledger. Eg: top-level account of 'Expenses:Medical:Vaccination' is 'Expenses'.

Parameters
sortwhether to sort the output before returning
Returns
the accounts

◆ transactions()

const Transactions& teditor::ledger::Parser::transactions ( ) const
inline

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