Don't use single code format characters anymore. Access to object details

will now always be done with "%(identifier)".
This commit is contained in:
John Wiegley 2008-09-18 11:25:56 -04:00
parent 235f3cc0ae
commit bdc180ff9c
4 changed files with 11 additions and 28 deletions

View file

@ -175,19 +175,13 @@ expr_t::ptr_op_t account_t::lookup(const string& name)
case 'd':
if (name == "depth")
return WRAP_FUNCTOR(get_wrapper<&get_depth>);
else if (name == "depth_spacer")
return WRAP_FUNCTOR(get_wrapper<&get_depth_spacer>);
break;
case 'f':
if (name.find("fmt_") == 0) {
switch (name[4]) {
case '_':
return WRAP_FUNCTOR(get_wrapper<&get_depth_spacer>);
case 'T':
return WRAP_FUNCTOR(get_wrapper<&get_total>);
case 'a':
return WRAP_FUNCTOR(get_wrapper<&get_partial_name>);
}
}
case 'p':
if (name == "partial_account")
return WRAP_FUNCTOR(get_wrapper<&get_partial_name>);
break;
case 't':

View file

@ -430,17 +430,6 @@ expr_t::ptr_op_t entry_t::lookup(const string& name)
return WRAP_FUNCTOR(get_wrapper<&get_date>);
break;
case 'f':
if (name.find("fmt_") == 0) {
switch (name[4]) {
case 'D':
return WRAP_FUNCTOR(get_wrapper<&get_date>);
case 'P':
return WRAP_FUNCTOR(get_wrapper<&get_payee>);
}
}
break;
case 'p':
if (name[1] == '\0' || name == "payee")
return WRAP_FUNCTOR(get_wrapper<&get_payee>);

View file

@ -237,7 +237,7 @@ format_t::element_t * format_t::parse_elements(const string& fmt)
buf[0] = *p;
buf[1] = '\0';
current->chars = buf;
current->expr.parse(string("fmt_") + *p);
current->expr.parse(buf);
break;
}
}

View file

@ -71,17 +71,17 @@ void release_session_context()
session_t::session_t()
: register_format
("%-.9D %-.20P %-.23A %!12(print_balance(fmt_t, 12, 67)) "
"%!12(print_balance(fmt_T, 12, 80, true))\n%/"
"%31|%-.23A %!12(print_balance(fmt_t, 12, 67)) "
"%!12(print_balance(fmt_T, 12, 80, true))\n"),
("%-.9(date) %-.20(payee) %-.23(account) %!12(print_balance(amount_expr, 12, 67)) "
"%!12(print_balance(total_expr, 12, 80, true))\n%/"
"%31|%-.23(account) %!12(print_balance(amount_expr, 12, 67)) "
"%!12(print_balance(total_expr, 12, 80, true))\n"),
wide_register_format
("%-.9D %-.35P %-.39A %22.108t %!22.132T\n%/"
"%48|%-.38A %22.108t %!22.132T\n"),
print_format
("%(date)%(cleared ? \" *\" : (uncleared ? \"\" : \" !\"))%(code ? \" (\" + code + \")\" : \"\") %(payee)\n %-34(account) %12(amount)\n%/ %-34(account) %12(amount)%(note ? \" ; \" + note : \"\")\n"),
balance_format
("%20T %_%-a\n"),
("%20(total_expr) %(depth_spacer)%-(partial_account)\n"),
equity_format
("\n%D %Y%C%P\n%/ %-34W %12t\n"),
plot_amount_format