Loading...
Searching...
No Matches
ledger::option_t< T > Class Template Reference

#include <option.h>

Inheritance diagram for ledger::option_t< T >:

Public Member Functions

string desc () const
value_t handler (call_scope_t &args)
virtual void handler_thunk (const optional< string > &)
virtual void handler_thunk (const optional< string > &, const string &)
void off ()
void on (const char *whence)
void on (const char *whence, const string &str)
void on (const optional< string > &whence)
void on (const optional< string > &whence, const string &str)
 operator bool () const
virtual value_t operator() (call_scope_t &args)
 option_t (const char *_name, const char _ch='\0')
 option_t (const option_t &other)
void report (std::ostream &out) const
string str () const
virtual ~option_t ()

Public Attributes

T * parent
string value
bool wants_arg

Protected Member Functions

option_toperator= (const option_t &)

Protected Attributes

const char ch
bool handled
const char * name
string::size_type name_len
optional< stringsource

Detailed Description

template<typename T>
class ledger::option_t< T >

Definition at line 55 of file option.h.

Constructor & Destructor Documentation

◆ option_t() [1/2]

template<typename T>
ledger::option_t< T >::option_t ( const char * _name,
const char _ch = '\0' )
inline

Definition at line 71 of file option.h.

References ch, DEBUG, handled, name, name_len, option_t(), parent, TRACE_CTOR, value, and wants_arg.

Referenced by operator=(), option_t(), option_t(), and ~option_t().

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

◆ option_t() [2/2]

template<typename T>
ledger::option_t< T >::option_t ( const option_t< T > & other)
inline

Definition at line 78 of file option.h.

References ch, handled, name, name_len, option_t(), parent, TRACE_CTOR, value, and wants_arg.

Here is the call graph for this function:

◆ ~option_t()

template<typename T>
virtual ledger::option_t< T >::~option_t ( )
inlinevirtual

Definition at line 90 of file option.h.

References option_t(), and TRACE_DTOR.

Here is the call graph for this function:

Member Function Documentation

◆ desc()

template<typename T>
string ledger::option_t< T >::desc ( ) const
inline

Definition at line 110 of file option.h.

References ch, and name.

Referenced by handler(), report(), and str().

Here is the caller graph for this function:

◆ handler()

template<typename T>
value_t ledger::option_t< T >::handler ( call_scope_t & args)
inline

Definition at line 171 of file option.h.

References desc(), ledger::call_scope_t::get(), on(), ledger::call_scope_t::size(), throw_, and wants_arg.

Referenced by operator()().

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

◆ handler_thunk() [1/2]

template<typename T>
virtual void ledger::option_t< T >::handler_thunk ( const optional< string > & )
inlinevirtual

Reimplemented in ledger::global_scope_t::helpoption_t, ledger::global_scope_t::versionoption_t, ledger::report_t::actualoption_t, ledger::report_t::add_budgetoption_t, ledger::report_t::average_lot_pricesoption_t, ledger::report_t::averageoption_t, ledger::report_t::basisoption_t, ledger::report_t::budgetoption_t, ledger::report_t::clearedoption_t, ledger::report_t::collapse_if_zerooption_t, ledger::report_t::collapseoption_t, ledger::report_t::currentoption_t, ledger::report_t::dailyoption_t, ledger::report_t::dcoption_t, ledger::report_t::deviationoption_t, ledger::report_t::gainoption_t, ledger::report_t::historicaloption_t, ledger::report_t::invertoption_t, ledger::report_t::marketoption_t, ledger::report_t::monthlyoption_t, ledger::report_t::no_coloroption_t, ledger::report_t::no_pageroption_t, ledger::report_t::no_revaluedoption_t, ledger::report_t::pendingoption_t, ledger::report_t::percentoption_t, ledger::report_t::priceoption_t, ledger::report_t::quantityoption_t, ledger::report_t::quarterlyoption_t, ledger::report_t::realoption_t, ledger::report_t::related_alloption_t, ledger::report_t::time_reportoption_t, ledger::report_t::unbudgetedoption_t, ledger::report_t::unclearedoption_t, ledger::report_t::unroundoption_t, ledger::report_t::weeklyoption_t, ledger::report_t::wideoption_t, ledger::report_t::yearlyoption_t, ledger::session_t::decimal_commaoption_t, and ledger::session_t::time_colonoption_t.

Definition at line 168 of file option.h.

Referenced by on(), and on().

Here is the caller graph for this function:

◆ handler_thunk() [2/2]

template<typename T>
virtual void ledger::option_t< T >::handler_thunk ( const optional< string > & ,
const string &  )
inlinevirtual

Definition at line 169 of file option.h.

◆ off()

template<typename T>
void ledger::option_t< T >::off ( )
inline

Definition at line 162 of file option.h.

References handled, source, and value.

◆ on() [1/4]

template<typename T>
void ledger::option_t< T >::on ( const char * whence)
inline

Definition at line 137 of file option.h.

References on().

Referenced by handler(), on(), and on().

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

◆ on() [2/4]

template<typename T>
void ledger::option_t< T >::on ( const char * whence,
const string & str )
inline

Definition at line 147 of file option.h.

References on(), and str().

Here is the call graph for this function:

◆ on() [3/4]

template<typename T>
void ledger::option_t< T >::on ( const optional< string > & whence)
inline

Definition at line 140 of file option.h.

References handled, handler_thunk(), and source.

Here is the call graph for this function:

◆ on() [4/4]

template<typename T>
void ledger::option_t< T >::on ( const optional< string > & whence,
const string & str )
inline

Definition at line 150 of file option.h.

References handled, handler_thunk(), source, str(), and value.

Here is the call graph for this function:

◆ operator bool()

template<typename T>
ledger::option_t< T >::operator bool ( ) const
inline

Definition at line 126 of file option.h.

References handled.

◆ operator()()

template<typename T>
virtual value_t ledger::option_t< T >::operator() ( call_scope_t & args)
inlinevirtual

Definition at line 193 of file option.h.

References ledger::call_scope_t::empty(), handled, handler(), ledger::call_scope_t::push_front(), ledger::string_value(), value, and wants_arg.

Here is the call graph for this function:

◆ operator=()

template<typename T>
option_t & ledger::option_t< T >::operator= ( const option_t< T > & )
protected

References option_t().

Here is the call graph for this function:

◆ report()

template<typename T>
void ledger::option_t< T >::report ( std::ostream & out) const
inline

Definition at line 94 of file option.h.

References desc(), handled, source, value, and wants_arg.

Here is the call graph for this function:

◆ str()

template<typename T>
string ledger::option_t< T >::str ( ) const
inline

Definition at line 130 of file option.h.

References assert, desc(), handled, throw_, and value.

Referenced by ledger::report_t::maybe_format(), on(), on(), and ledger::report_t::report_format().

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

Member Data Documentation

◆ ch

template<typename T>
const char ledger::option_t< T >::ch
protected

Definition at line 60 of file option.h.

Referenced by desc(), option_t(), and option_t().

◆ handled

template<typename T>
bool ledger::option_t< T >::handled
protected

Definition at line 61 of file option.h.

Referenced by off(), on(), on(), operator bool(), operator()(), option_t(), option_t(), report(), and str().

◆ name

template<typename T>
const char* ledger::option_t< T >::name
protected

Definition at line 58 of file option.h.

Referenced by desc(), option_t(), and option_t().

◆ name_len

template<typename T>
string::size_type ledger::option_t< T >::name_len
protected

Definition at line 59 of file option.h.

Referenced by option_t(), and option_t().

◆ parent

template<typename T>
T* ledger::option_t< T >::parent

Definition at line 67 of file option.h.

Referenced by option_t(), and option_t().

◆ source

template<typename T>
optional<string> ledger::option_t< T >::source
protected

Definition at line 62 of file option.h.

Referenced by off(), on(), on(), and report().

◆ value

template<typename T>
string ledger::option_t< T >::value

Definition at line 68 of file option.h.

Referenced by off(), on(), operator()(), option_t(), option_t(), report(), and str().

◆ wants_arg

template<typename T>
bool ledger::option_t< T >::wants_arg

Definition at line 69 of file option.h.

Referenced by handler(), operator()(), option_t(), option_t(), and report().


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