ECC-1899: Functor for filter

This commit is contained in:
shahramn 2024-08-09 16:00:32 +01:00
parent eac06e8853
commit 137136b893
1 changed files with 11 additions and 3 deletions

View File

@ -98,9 +98,9 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres)
{
grib_expression_functor* e = (grib_expression_functor*)g;
if (STR_EQUAL(e->name, "lookup")) {
return GRIB_SUCCESS;
}
// if (STR_EQUAL(e->name, "lookup")) {
// return GRIB_SUCCESS;
// }
if (STR_EQUAL(e->name, "new")) {
*lres = h->loader != NULL;
@ -128,6 +128,14 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres)
return GRIB_INVALID_ARGUMENT;
}
if (STR_EQUAL(e->name, "debug_mode")) {
const int n = grib_arguments_get_count(e->args);
if (n != 1) return GRIB_INVALID_ARGUMENT;
const int dmode = grib_arguments_get_long(h, e->args, 0);
grib_context_set_debug(0, dmode);
return GRIB_SUCCESS;
}
if (STR_EQUAL(e->name, "missing")) {
const char* keyName = grib_arguments_get_name(h, e->args, 0);
if (keyName) {