From 137136b8939df7f3a373f5e27ff49e8be0dc672a Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 9 Aug 2024 16:00:32 +0100 Subject: [PATCH] ECC-1899: Functor for filter --- src/grib_expression_class_functor.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/grib_expression_class_functor.cc b/src/grib_expression_class_functor.cc index 332d219ce..0f1d80214 100644 --- a/src/grib_expression_class_functor.cc +++ b/src/grib_expression_class_functor.cc @@ -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) {