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 charname
 
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 DEBUG, ledger::option_t< T >::name, and TRACE_CTOR.

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

◆ ~option_t()

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

Definition at line 90 of file option.h.

References TRACE_DTOR.

Member Function Documentation

◆ desc()

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

Definition at line 110 of file option.h.

References ledger::option_t< T >::ch, ledger::downcast(), and ledger::option_t< T >::name.

Referenced by ledger::option_t< T >::handler(), ledger::option_t< T >::report(), and ledger::option_t< T >::str().

+ Here is the call graph for this function:
+ 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 ledger::option_t< T >::desc(), ledger::downcast(), ledger::call_scope_t::get(), ledger::option_t< T >::on(), ledger::call_scope_t::size(), throw_, and ledger::option_t< T >::wants_arg.

Referenced by ledger::option_t< T >::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::averageoption_t, ledger::report_t::basisoption_t, ledger::report_t::budgetoption_t, ledger::report_t::clearedoption_t, ledger::report_t::collapseoption_t, ledger::report_t::collapse_if_zerooption_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::average_lot_pricesoption_t, ledger::report_t::marketoption_t, ledger::report_t::monthlyoption_t, ledger::report_t::no_coloroption_t, ledger::report_t::no_revaluedoption_t, ledger::report_t::no_pageroption_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 ledger::option_t< T >::on(), and ledger::option_t< T >::on().

+ Here is the caller graph for this function:

◆ handler_thunk() [2/2]

◆ off()

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

Definition at line 162 of file option.h.

References ledger::downcast(), ledger::option_t< T >::handled, ledger::option_t< T >::source, and ledger::option_t< T >::value.

+ Here is the call graph for this function:

◆ 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 ledger::option_t< T >::on().

Referenced by ledger::option_t< T >::handler(), ledger::option_t< T >::on(), and ledger::option_t< T >::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 ledger::option_t< T >::on(), and ledger::option_t< T >::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 ledger::option_t< T >::handled, ledger::option_t< T >::handler_thunk(), and ledger::option_t< T >::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 ledger::downcast(), ledger::option_t< T >::handled, ledger::option_t< T >::handler_thunk(), ledger::option_t< T >::source, ledger::option_t< T >::str(), and ledger::option_t< T >::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 ledger::option_t< T >::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(), ledger::option_t< T >::handled, ledger::option_t< T >::handler(), ledger::call_scope_t::push_front(), ledger::string_value(), ledger::option_t< T >::value, and ledger::option_t< T >::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

◆ report()

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

Definition at line 94 of file option.h.

References ledger::option_t< T >::desc(), ledger::option_t< T >::handled, ledger::option_t< T >::source, ledger::option_t< T >::value, and ledger::option_t< T >::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, ledger::option_t< T >::desc(), ledger::downcast(), ledger::option_t< T >::handled, throw_, and ledger::option_t< T >::value.

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

+ 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 ledger::option_t< T >::desc().

◆ handled

◆ name

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

Definition at line 58 of file option.h.

Referenced by ledger::option_t< T >::desc(), and ledger::option_t< T >::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.

◆ parent

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

Definition at line 67 of file option.h.

◆ source

◆ value

◆ wants_arg


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