Add valexpr functions for lot dates, prices and tags
This commit is contained in:
parent
d5b1ee56e1
commit
77c9d7b1ff
2 changed files with 36 additions and 0 deletions
|
|
@ -315,6 +315,39 @@ value_t report_t::fn_price(call_scope_t& scope)
|
||||||
return args.value_at(0).price();
|
return args.value_at(0).price();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
value_t report_t::fn_lot_date(call_scope_t& scope)
|
||||||
|
{
|
||||||
|
interactive_t args(scope, "v");
|
||||||
|
if (args.value_at(0).is_annotated()) {
|
||||||
|
const annotation_t& details(args.value_at(0).annotation());
|
||||||
|
if (details.date)
|
||||||
|
return *details.date;
|
||||||
|
}
|
||||||
|
return NULL_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
value_t report_t::fn_lot_price(call_scope_t& scope)
|
||||||
|
{
|
||||||
|
interactive_t args(scope, "v");
|
||||||
|
if (args.value_at(0).is_annotated()) {
|
||||||
|
const annotation_t& details(args.value_at(0).annotation());
|
||||||
|
if (details.price)
|
||||||
|
return *details.price;
|
||||||
|
}
|
||||||
|
return NULL_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
value_t report_t::fn_lot_tag(call_scope_t& scope)
|
||||||
|
{
|
||||||
|
interactive_t args(scope, "v");
|
||||||
|
if (args.value_at(0).is_annotated()) {
|
||||||
|
const annotation_t& details(args.value_at(0).annotation());
|
||||||
|
if (details.tag)
|
||||||
|
return string_value(*details.tag);
|
||||||
|
}
|
||||||
|
return NULL_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
value_t fn_black(call_scope_t&) {
|
value_t fn_black(call_scope_t&) {
|
||||||
return string_value("black");
|
return string_value("black");
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,9 @@ public:
|
||||||
value_t fn_ansify_if(call_scope_t& scope);
|
value_t fn_ansify_if(call_scope_t& scope);
|
||||||
value_t fn_percent(call_scope_t& scope);
|
value_t fn_percent(call_scope_t& scope);
|
||||||
value_t fn_price(call_scope_t& scope);
|
value_t fn_price(call_scope_t& scope);
|
||||||
|
value_t fn_lot_date(call_scope_t& scope);
|
||||||
|
value_t fn_lot_price(call_scope_t& scope);
|
||||||
|
value_t fn_lot_tag(call_scope_t& scope);
|
||||||
|
|
||||||
value_t fn_now(call_scope_t&) {
|
value_t fn_now(call_scope_t&) {
|
||||||
return terminus;
|
return terminus;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue