Loading...
Searching...
No Matches
ledger::format_t Class Reference

#include <format.h>

+ Inheritance diagram for ledger::format_t:
+ Collaboration diagram for ledger::format_t:

Public Types

enum  elision_style_t { TRUNCATE_TRAILING , TRUNCATE_MIDDLE , TRUNCATE_LEADING , ABBREVIATE }
 
typedef function< result_type(call_scope_t &) func_t)
 
typedef string result_type
 

Public Member Functions

result_type calc ()
 
result_type calc (scope_t &scope)
 
virtual void compile (scope_t &scope)
 
virtual string context_to_str () const
 
virtual void dump (std::ostream &out) const
 
string dump_to_str () const
 
 format_t ()
 
 format_t (const string &_str, scope_t *context=NULL)
 
scope_tget_context ()
 
virtual void mark_uncompiled ()
 
virtual operator bool () const throw ()
 
result_type operator() (scope_t &scope)
 
void parse (const string &expr_str, const parse_flags_t &flags=PARSE_DEFAULT)
 
virtual void parse (std::istream &, const parse_flags_t &=PARSE_DEFAULT, const optional< string > &original_string=none)
 
void parse_format (const string &_format, const optional< format_t & > &tmpl=none)
 
result_type preview (std::ostream &out, scope_t &scope) const
 
string preview_to_str (scope_t &) const
 
virtual void print (std::ostream &) const
 
string print_to_str () const
 
virtual result_type real_calc (scope_t &scope)
 
void recompile (scope_t &scope)
 
void set_context (scope_t *scope)
 
void set_text (const string &txt)
 
virtual string text () const throw ()
 
virtual ~format_t ()
 

Static Public Member Functions

static string truncate (const unistring &str, const std::size_t width, const std::size_t account_abbrev_length=0)
 

Static Public Attributes

static enum ledger::format_t::elision_style_t default_style
 
static bool default_style_changed
 

Protected Attributes

bool compiled
 
scope_tcontext
 
string str
 

Detailed Description

Definition at line 55 of file format.h.

Member Typedef Documentation

◆ func_t

Definition at line 75 of file exprbase.h.

◆ result_type

typedef string ledger::expr_base_t< string >::result_type
inherited

Definition at line 73 of file exprbase.h.

Member Enumeration Documentation

◆ elision_style_t

Enumerator
TRUNCATE_TRAILING 
TRUNCATE_MIDDLE 
TRUNCATE_LEADING 
ABBREVIATE 

Definition at line 110 of file format.h.

Constructor & Destructor Documentation

◆ format_t() [1/2]

ledger::format_t::format_t ( )
inline

Definition at line 124 of file format.h.

References TRACE_CTOR.

◆ format_t() [2/2]

ledger::format_t::format_t ( const string & _str,
scope_t * context = NULL )
inline

Definition at line 127 of file format.h.

References ledger::downcast(), parse_format(), and TRACE_CTOR.

+ Here is the call graph for this function:

◆ ~format_t()

virtual ledger::format_t::~format_t ( )
inlinevirtual

Definition at line 133 of file format.h.

References TRACE_DTOR.

Member Function Documentation

◆ calc() [1/2]

result_type ledger::expr_base_t< string >::calc ( )
inlineinherited

Definition at line 180 of file exprbase.h.

◆ calc() [2/2]

result_type ledger::expr_base_t< string >::calc ( scope_t & scope)
inlineinherited

Definition at line 155 of file exprbase.h.

◆ compile()

virtual void ledger::expr_base_t< string >::compile ( scope_t & scope)
inlinevirtualinherited

Definition at line 143 of file exprbase.h.

◆ context_to_str()

virtual string ledger::expr_base_t< string >::context_to_str ( ) const
inlinevirtualinherited

Definition at line 192 of file exprbase.h.

◆ dump()

virtual void ledger::format_t::dump ( std::ostream & out) const
inlinevirtual

Reimplemented from ledger::expr_base_t< string >.

Definition at line 154 of file format.h.

References ledger::downcast().

+ Here is the call graph for this function:

◆ dump_to_str()

string ledger::expr_base_t< string >::dump_to_str ( ) const
inlineinherited

Definition at line 201 of file exprbase.h.

◆ get_context()

scope_t * ledger::expr_base_t< string >::get_context ( )
inlineinherited

Definition at line 185 of file exprbase.h.

◆ mark_uncompiled()

virtual void ledger::format_t::mark_uncompiled ( )
inlinevirtual

Reimplemented from ledger::expr_base_t< string >.

Definition at line 143 of file format.h.

References ledger::downcast(), and ledger::expr_base_t< ResultType >::mark_uncompiled().

+ Here is the call graph for this function:

◆ operator bool()

virtual ledger::expr_base_t< string >::operator bool ( ) const
throw ( )
inlinevirtualinherited

Definition at line 111 of file exprbase.h.

◆ operator()()

result_type ledger::expr_base_t< string >::operator() ( scope_t & scope)
inlineinherited

Definition at line 151 of file exprbase.h.

◆ parse() [1/2]

void ledger::expr_base_t< string >::parse ( const string & expr_str,
const parse_flags_t & flags = PARSE_DEFAULT )
inlineinherited

Definition at line 123 of file exprbase.h.

◆ parse() [2/2]

virtual void ledger::expr_base_t< string >::parse ( std::istream & ,
const parse_flags_t & = PARSE_DEFAULT,
const optional< string > & original_string = none )
inlinevirtualinherited

Definition at line 128 of file exprbase.h.

◆ parse_format()

void ledger::format_t::parse_format ( const string & _format,
const optional< format_t & > & tmpl = none )
inline

Definition at line 137 of file format.h.

References ledger::downcast(), and ledger::expr_base_t< string >::set_text().

Referenced by format_t().

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

◆ preview()

result_type ledger::expr_base_t< string >::preview ( std::ostream & out,
scope_t & scope ) const
inlineinherited

Definition at line 215 of file exprbase.h.

◆ preview_to_str()

string ledger::expr_base_t< string >::preview_to_str ( scope_t & ) const
inlineinherited

Definition at line 206 of file exprbase.h.

◆ print()

virtual void ledger::expr_base_t< string >::print ( std::ostream & ) const
inlinevirtualinherited

Definition at line 212 of file exprbase.h.

◆ print_to_str()

string ledger::expr_base_t< string >::print_to_str ( ) const
inlineinherited

Definition at line 196 of file exprbase.h.

◆ real_calc()

virtual result_type ledger::format_t::real_calc ( scope_t & scope)
virtual

◆ recompile()

void ledger::expr_base_t< string >::recompile ( scope_t & scope)
inlineinherited

Definition at line 138 of file exprbase.h.

◆ set_context()

void ledger::expr_base_t< string >::set_context ( scope_t * scope)
inlineinherited

Definition at line 188 of file exprbase.h.

◆ set_text()

void ledger::expr_base_t< string >::set_text ( const string & txt)
inlineinherited

Definition at line 118 of file exprbase.h.

◆ text()

virtual string ledger::expr_base_t< string >::text ( ) const
throw ( )
inlinevirtualinherited

Definition at line 115 of file exprbase.h.

◆ truncate()

static string ledger::format_t::truncate ( const unistring & str,
const std::size_t width,
const std::size_t account_abbrev_length = 0 )
static

Member Data Documentation

◆ compiled

bool ledger::expr_base_t< string >::compiled
protectedinherited

Definition at line 80 of file exprbase.h.

◆ context

scope_t* ledger::expr_base_t< string >::context
protectedinherited

Definition at line 78 of file exprbase.h.

◆ default_style

enum ledger::format_t::elision_style_t ledger::format_t::default_style
static

◆ default_style_changed

bool ledger::format_t::default_style_changed
static

Definition at line 117 of file format.h.

◆ str

string ledger::expr_base_t< string >::str
protectedinherited

Definition at line 79 of file exprbase.h.


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