diff --git a/src/accessor/grib_accessor_class_ascii.cc b/src/accessor/grib_accessor_class_ascii.cc index 0b0356fdc..b6cf3e63e 100644 --- a/src/accessor/grib_accessor_class_ascii.cc +++ b/src/accessor/grib_accessor_class_ascii.cc @@ -49,7 +49,7 @@ int grib_accessor_ascii_t::unpack_string(char* val, size_t* len) if (*len < (alen + 1)) { grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - class_name_, name_, alen + 1, *len); + getClassName().get().c_str(), name_, alen + 1, *len); *len = alen + 1; return GRIB_BUFFER_TOO_SMALL; } diff --git a/src/accessor/grib_accessor_class_bitmap.cc b/src/accessor/grib_accessor_class_bitmap.cc index f922b7890..b192f96a3 100644 --- a/src/accessor/grib_accessor_class_bitmap.cc +++ b/src/accessor/grib_accessor_class_bitmap.cc @@ -171,7 +171,7 @@ int grib_accessor_bitmap_t::unpack_string(char* val, size_t* len) if (*len < l) { grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - class_name_, name_, l, *len); + getClassName().get().c_str(), name_, l, *len); *len = l; return GRIB_BUFFER_TOO_SMALL; } diff --git a/src/accessor/grib_accessor_class_bufr_data_element.cc b/src/accessor/grib_accessor_class_bufr_data_element.cc index d417febdd..1f1962196 100644 --- a/src/accessor/grib_accessor_class_bufr_data_element.cc +++ b/src/accessor/grib_accessor_class_bufr_data_element.cc @@ -27,8 +27,8 @@ grib_accessor* grib_accessor_bufr_data_element_t::make_clone(grib_section* s, in creator.name_space = (char*)""; creator.set = 0; creator.name = (char*)"unknown"; - if (strcmp(class_name_, "bufr_data_element")) { - grib_context_log(context_, GRIB_LOG_FATAL, "wrong accessor type: '%s' should be '%s'", class_name_, "bufr_data_element"); + if (strcmp(getClassName().get().c_str(), "bufr_data_element")) { + grib_context_log(context_, GRIB_LOG_FATAL, "wrong accessor type: '%s' should be '%s'", getClassName().get().c_str(), "bufr_data_element"); } *err = 0; diff --git a/src/accessor/grib_accessor_class_change_scanning_direction.cc b/src/accessor/grib_accessor_class_change_scanning_direction.cc index 5f99198dd..780b68fa8 100644 --- a/src/accessor/grib_accessor_class_change_scanning_direction.cc +++ b/src/accessor/grib_accessor_class_change_scanning_direction.cc @@ -44,7 +44,7 @@ int grib_accessor_change_scanning_direction_t::pack_long(const long* val, size_t double* values = NULL; const grib_context* c = context_; grib_handle* h = grib_handle_of_accessor(this); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); if (*val == 0) return GRIB_SUCCESS; diff --git a/src/accessor/grib_accessor_class_codetable.cc b/src/accessor/grib_accessor_class_codetable.cc index 134443cdf..eee2f8c61 100644 --- a/src/accessor/grib_accessor_class_codetable.cc +++ b/src/accessor/grib_accessor_class_codetable.cc @@ -443,7 +443,7 @@ int codes_codetable_get_contents_malloc(const grib_handle* h, const char* key, c grib_accessor* aa = grib_find_accessor(h, key); if (!aa) return GRIB_NOT_FOUND; - if (!STR_EQUAL(aa->class_name_, "codetable")) { + if (!STR_EQUAL(aa->getClassName().get().c_str(), "codetable")) { return GRIB_INVALID_ARGUMENT; // key is not a codetable } @@ -607,7 +607,7 @@ int grib_accessor_codetable_t::unpack_string(char* buffer, size_t* len) l = strlen(tmp) + 1; if (*len < l) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", cclass_name, name_, l, *len); diff --git a/src/accessor/grib_accessor_class_codetable_title.cc b/src/accessor/grib_accessor_class_codetable_title.cc index d2de79b56..9776a0b77 100644 --- a/src/accessor/grib_accessor_class_codetable_title.cc +++ b/src/accessor/grib_accessor_class_codetable_title.cc @@ -54,7 +54,7 @@ int grib_accessor_codetable_title_t::unpack_string(char* buffer, size_t* len) l = strlen(tmp) + 1; if (*len < l) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", cclass_name, name_, l, *len); diff --git a/src/accessor/grib_accessor_class_codetable_units.cc b/src/accessor/grib_accessor_class_codetable_units.cc index 06a20e56b..1855e1475 100644 --- a/src/accessor/grib_accessor_class_codetable_units.cc +++ b/src/accessor/grib_accessor_class_codetable_units.cc @@ -55,7 +55,7 @@ int grib_accessor_codetable_units_t::unpack_string(char* buffer, size_t* len) l = strlen(tmp) + 1; if (*len < l) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", cclass_name, name_, l, *len); diff --git a/src/accessor/grib_accessor_class_concept.cc b/src/accessor/grib_accessor_class_concept.cc index 300b7f827..31339c2fe 100644 --- a/src/accessor/grib_accessor_class_concept.cc +++ b/src/accessor/grib_accessor_class_concept.cc @@ -399,7 +399,7 @@ int grib_accessor_concept_t::pack_long(const long* val, size_t* len) long newParamId = 0; if (grib_get_long(h, "paramIdForConversion", &newParamId) == GRIB_SUCCESS && newParamId > 0) { if (context_->debug) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); fprintf(stderr, "ECCODES DEBUG %s::%s: Changing %s from %ld to %ld\n", cclass_name, __func__, name_, *val, newParamId); } diff --git a/src/accessor/grib_accessor_class_data_ccsds_packing.cc b/src/accessor/grib_accessor_class_data_ccsds_packing.cc index b0e4cbf6a..d567d84b4 100644 --- a/src/accessor/grib_accessor_class_data_ccsds_packing.cc +++ b/src/accessor/grib_accessor_class_data_ccsds_packing.cc @@ -87,7 +87,7 @@ static void print_aec_stream_info(struct aec_stream* strm, const char* func) int grib_accessor_data_ccsds_packing_t::pack_double(const double* val, size_t* len) { grib_handle* hand = grib_handle_of_accessor(this); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); int err = GRIB_SUCCESS; size_t buflen = 0, i = 0; bool is_constant_field = false; @@ -381,7 +381,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) grib_accessor_data_ccsds_packing_t* self = (grib_accessor_data_ccsds_packing_t*)a; static_assert(std::is_floating_point::value, "Requires floating point numbers"); grib_handle* hand = grib_handle_of_accessor(a); - const char* cclass_name = a->class_name_; + const char* cclass_name = a->getClassName().get().c_str(); int err = GRIB_SUCCESS, i = 0; size_t buflen = 0; diff --git a/src/accessor/grib_accessor_class_data_complex_packing.cc b/src/accessor/grib_accessor_class_data_complex_packing.cc index 02147a063..0abb5e551 100644 --- a/src/accessor/grib_accessor_class_data_complex_packing.cc +++ b/src/accessor/grib_accessor_class_data_complex_packing.cc @@ -168,7 +168,7 @@ double calculate_pfactor(const grib_context* ctx, const double* spectralField, l int grib_accessor_data_complex_packing_t::pack_double(const double* val, size_t* len) { grib_handle* gh = grib_handle_of_accessor(this); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); size_t i = 0; int ret = GRIB_SUCCESS; @@ -539,7 +539,7 @@ static int unpack_real(grib_accessor* a, T* val, size_t* len) grib_accessor_data_complex_packing_t* self = (grib_accessor_data_complex_packing_t*)a; static_assert(std::is_floating_point::value, "Requires floating point numbers"); grib_handle* gh = grib_handle_of_accessor(a); - const char* cclass_name = a->class_name_; + const char* cclass_name = a->getClassName().get().c_str(); size_t i = 0; int ret = GRIB_SUCCESS; diff --git a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc index c505995e6..f770ed5c7 100644 --- a/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc +++ b/src/accessor/grib_accessor_class_data_g1second_order_constant_width_packing.cc @@ -177,7 +177,7 @@ int grib_accessor_data_g1second_order_constant_width_packing_t::unpack_double(do int grib_accessor_data_g1second_order_constant_width_packing_t::pack_double(const double* cval, size_t* len) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: %s: Not implemented", cclass_name, __func__); return GRIB_NOT_IMPLEMENTED; } diff --git a/src/accessor/grib_accessor_class_data_g22order_packing.cc b/src/accessor/grib_accessor_class_data_g22order_packing.cc index 4608dcce0..280893a90 100644 --- a/src/accessor/grib_accessor_class_data_g22order_packing.cc +++ b/src/accessor/grib_accessor_class_data_g22order_packing.cc @@ -774,7 +774,7 @@ static void merge_j(struct section* h, int ref_bits, int width_bits, int has_und int grib_accessor_data_g22order_packing_t::pack_double(const double* val, size_t* len) { grib_handle* gh = grib_handle_of_accessor(this); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); int err = 0; @@ -1464,7 +1464,7 @@ static int unpack(grib_accessor* a, T* val, const size_t* len) { grib_accessor_data_g22order_packing_t* self = reinterpret_cast(a); static_assert(std::is_floating_point::value, "Requires floating points numbers"); - const char* cclass_name = a->class_name_; + const char* cclass_name = a->getClassName().get().c_str(); grib_handle* gh = grib_handle_of_accessor(a); size_t i = 0; diff --git a/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc b/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc index 83a5451f1..4769a103b 100644 --- a/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc +++ b/src/accessor/grib_accessor_class_data_g2bifourier_packing.cc @@ -566,7 +566,7 @@ cleanup: int grib_accessor_data_g2bifourier_packing_t::pack_double(const double* val, size_t* len) { grib_handle* gh = grib_handle_of_accessor(this); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); size_t buflen = 0; size_t hsize = 0; diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc index f078559d6..29732e62e 100644 --- a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc @@ -216,7 +216,7 @@ int grib_accessor_data_jpeg2000_packing_t::pack_double(const double* cval, size_ double units_factor = 1.0; double units_bias = 0.0; double* val = (double*)cval; - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); dirty_ = 1; diff --git a/src/accessor/grib_accessor_class_data_png_packing.cc b/src/accessor/grib_accessor_class_data_png_packing.cc index df862852a..ef7d12c26 100644 --- a/src/accessor/grib_accessor_class_data_png_packing.cc +++ b/src/accessor/grib_accessor_class_data_png_packing.cc @@ -234,7 +234,7 @@ static bool is_constant(const double* values, size_t n_vals) int grib_accessor_data_png_packing_t::pack_double(const double* val, size_t* len) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); int err = GRIB_SUCCESS; bool is_constant_field = false; diff --git a/src/accessor/grib_accessor_class_data_run_length_packing.cc b/src/accessor/grib_accessor_class_data_run_length_packing.cc index 27ecec83f..5fe3bb333 100644 --- a/src/accessor/grib_accessor_class_data_run_length_packing.cc +++ b/src/accessor/grib_accessor_class_data_run_length_packing.cc @@ -35,7 +35,7 @@ int grib_accessor_data_run_length_packing_t::value_count(long* number_of_values) int grib_accessor_data_run_length_packing_t::unpack_double(double* val, size_t* len) { grib_handle* gh = grib_handle_of_accessor(this); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); int err = GRIB_SUCCESS; long seclen, number_of_values, bits_per_value, max_level_value, number_of_level_values, decimal_scale_factor; long* level_values = NULL; @@ -140,7 +140,7 @@ int grib_accessor_data_run_length_packing_t::unpack_double(double* val, size_t* int grib_accessor_data_run_length_packing_t::pack_double(const double* val, size_t* len) { grib_handle* gh = grib_handle_of_accessor(this); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); int err = GRIB_SUCCESS; long number_of_values, bits_per_value, max_level_value, number_of_level_values, decimal_scale_factor; long* level_values = NULL; diff --git a/src/accessor/grib_accessor_class_data_sh_packed.cc b/src/accessor/grib_accessor_class_data_sh_packed.cc index 0f1979343..07ad70714 100644 --- a/src/accessor/grib_accessor_class_data_sh_packed.cc +++ b/src/accessor/grib_accessor_class_data_sh_packed.cc @@ -40,7 +40,7 @@ int grib_accessor_data_sh_packed_t::value_count(long* count) { grib_handle* hand = grib_handle_of_accessor(this); int ret = 0; - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); long sub_j = 0; long sub_k = 0; diff --git a/src/accessor/grib_accessor_class_data_simple_packing.cc b/src/accessor/grib_accessor_class_data_simple_packing.cc index b43513f8f..d3909808e 100644 --- a/src/accessor/grib_accessor_class_data_simple_packing.cc +++ b/src/accessor/grib_accessor_class_data_simple_packing.cc @@ -67,7 +67,7 @@ int grib_accessor_data_simple_packing_t::value_count(long* number_of_values) int grib_accessor_data_simple_packing_t::unpack_double_element(size_t idx, double* val) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); long n_vals = 0; int err = 0; @@ -163,7 +163,7 @@ static int unpack(grib_accessor* a, T* val, size_t* len) grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; static_assert(std::is_floating_point::value, "Requires floating point numbers"); - const char* cclass_name = a->class_name_; + const char* cclass_name = a->getClassName().get().c_str(); grib_handle* gh = grib_handle_of_accessor(a); unsigned char* buf = (unsigned char*)grib_handle_of_accessor(a)->buffer->data; @@ -315,7 +315,7 @@ static int _unpack_double(grib_accessor* a, double* val, size_t* len, unsigned c { grib_accessor_data_simple_packing_t* self = (grib_accessor_data_simple_packing_t*)a; grib_handle* gh = grib_handle_of_accessor(a); - const char* cclass_name = a->class_name_; + const char* cclass_name = a->getClassName().get().c_str(); size_t i = 0; int err = 0; @@ -459,7 +459,7 @@ int grib_accessor_data_simple_packing_t::unpack_double_subarray(double* val, siz int grib_accessor_data_simple_packing_t::pack_double(const double* val, size_t* len) { grib_handle* gh = grib_handle_of_accessor(this); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); size_t i = 0; size_t n_vals = *len; diff --git a/src/accessor/grib_accessor_class_double.cc b/src/accessor/grib_accessor_class_double.cc index f576452e4..866dd76f1 100644 --- a/src/accessor/grib_accessor_class_double.cc +++ b/src/accessor/grib_accessor_class_double.cc @@ -25,7 +25,7 @@ int grib_accessor_double_t::unpack_string(char* v, size_t* len) char repres[1024]; char format[32] = "%g"; grib_handle* h = grib_handle_of_accessor(this); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); unpack_double(&val, &l); if ((val == GRIB_MISSING_DOUBLE) && ((flags_ & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0)) { diff --git a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc index fdf183d37..6ec6178f8 100644 --- a/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc +++ b/src/accessor/grib_accessor_class_from_scale_factor_scaled_value.cc @@ -65,7 +65,7 @@ int grib_accessor_from_scale_factor_scaled_value_t::pack_double(const double* va factor_accessor_num_bits = factor_accessor->length_ * 8; maxval_value = (1UL << value_accessor_num_bits) - 2; // exclude missing maxval_factor = (1UL << factor_accessor_num_bits) - 2; // exclude missing - if (strcmp(factor_accessor->class_name_, "signed") == 0) { + if (strcmp(factor_accessor->getClassName().get().c_str(), "signed") == 0) { maxval_factor = (1UL << (factor_accessor_num_bits - 1)) - 1; } diff --git a/src/accessor/grib_accessor_class_g1_message_length.cc b/src/accessor/grib_accessor_class_g1_message_length.cc index 29e06e060..075ee5bdf 100644 --- a/src/accessor/grib_accessor_class_g1_message_length.cc +++ b/src/accessor/grib_accessor_class_g1_message_length.cc @@ -107,7 +107,7 @@ int grib_accessor_g1_message_length_t::pack_long(const long* val, size_t* len) grib_find_accessor(grib_handle_of_accessor(this), sec4_length_), &total_length, &sec4_length); if (total_length != *val) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s %s: Failed to set GRIB1 message length to %ld" " (actual length=%ld)", diff --git a/src/accessor/grib_accessor_class_g2date.cc b/src/accessor/grib_accessor_class_g2date.cc index 8796a552b..51e5289a9 100644 --- a/src/accessor/grib_accessor_class_g2date.cc +++ b/src/accessor/grib_accessor_class_g2date.cc @@ -65,7 +65,7 @@ int grib_accessor_g2date_t::pack_long(const long* val, size_t* len) if (!is_date_valid(year, month, day, 0, 0, 0)) { // ECC-1777: For now just a warning. Will later change to an error fprintf(stderr, "ECCODES WARNING : %s:%s: Date is not valid! year=%ld month=%ld day=%ld\n", - class_name_, __func__, year, month, day); + getClassName().get().c_str(), __func__, year, month, day); } if ((ret = grib_set_long_internal(grib_handle_of_accessor(this), day_, day)) != GRIB_SUCCESS) diff --git a/src/accessor/grib_accessor_class_g2end_step.cc b/src/accessor/grib_accessor_class_g2end_step.cc index 660f8e45e..b448fe843 100644 --- a/src/accessor/grib_accessor_class_g2end_step.cc +++ b/src/accessor/grib_accessor_class_g2end_step.cc @@ -495,7 +495,7 @@ static int pack_long_(grib_accessor* a, const long end_step_value, const long en grib_context_log(h->context, GRIB_LOG_ERROR, "%s:%s: Date/Time is not valid! " "year=%ld month=%ld day=%ld hour=%ld minute=%ld second=%ld", - a->class_name_, __func__, year, month, day, hour, minute, second); + a->getClassName().get().c_str(), __func__, year, month, day, hour, minute, second); return GRIB_DECODING_ERROR; } diff --git a/src/accessor/grib_accessor_class_gaussian_grid_name.cc b/src/accessor/grib_accessor_class_gaussian_grid_name.cc index b1c506f11..fa65f6a18 100644 --- a/src/accessor/grib_accessor_class_gaussian_grid_name.cc +++ b/src/accessor/grib_accessor_class_gaussian_grid_name.cc @@ -66,7 +66,7 @@ int grib_accessor_gaussian_grid_name_t::unpack_string(char* v, size_t* len) length = strlen(tmp) + 1; if (*len < length) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", cclass_name, name_, length, *len); diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index 6fae7eb23..ca746ad9a 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -112,7 +112,7 @@ long grib_accessor_gen_t::byte_count() long grib_accessor_gen_t::get_native_type() { grib_context_log(context_, GRIB_LOG_ERROR, - "Accessor %s [%s] must implement 'get_native_type'", name_, class_name_); + "Accessor %s [%s] must implement 'get_native_type'", name_, getClassName().get().c_str()); return GRIB_TYPE_UNDEFINED; } @@ -354,7 +354,7 @@ int grib_accessor_gen_t::pack_double(const double* v, size_t* len) is_overridden_[PACK_DOUBLE] = 0; grib_context* c = context_; - if (is_overridden_[PACK_LONG] || strcmp(class_name_, "codetable") == 0) { + if (is_overridden_[PACK_LONG] || strcmp(getClassName().get().c_str(), "codetable") == 0) { /* ECC-648: Special case of codetable */ return pack_double_array_as_long(this, v, len); } @@ -453,7 +453,7 @@ int grib_accessor_gen_t::notify_change(grib_accessor* observed) void grib_accessor_gen_t::update_size(size_t s) { grib_context_log(context_, GRIB_LOG_FATAL, - "Accessor %s [%s] must implement 'update_size'", name_, class_name_); + "Accessor %s [%s] must implement 'update_size'", name_, getClassName().get().c_str()); } grib_accessor* grib_accessor_gen_t::next_accessor() @@ -540,7 +540,7 @@ int grib_accessor_gen_t::unpack_double_subarray(double* val, size_t start, size_ grib_accessor* grib_accessor_gen_t::clone(grib_section* s, int* err) { grib_context* ct = context_; - grib_context_log(ct, GRIB_LOG_DEBUG, "clone %s ==> %s", class_name_, name_); + grib_context_log(ct, GRIB_LOG_DEBUG, "clone %s ==> %s", getClassName().get().c_str(), name_); return make_clone(s, err); } diff --git a/src/accessor/grib_accessor_class_group.cc b/src/accessor/grib_accessor_class_group.cc index b73eda004..b32eddfc8 100644 --- a/src/accessor/grib_accessor_class_group.cc +++ b/src/accessor/grib_accessor_class_group.cc @@ -79,7 +79,7 @@ int grib_accessor_group_t::unpack_string(char* val, size_t* len) if (*len < l) { grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - class_name_, name_, l, *len); + getClassName().get().c_str(), name_, l, *len); *len = l; return GRIB_ARRAY_TOO_SMALL; } diff --git a/src/accessor/grib_accessor_class_long.cc b/src/accessor/grib_accessor_class_long.cc index fb2a682b6..ce73cb4e5 100644 --- a/src/accessor/grib_accessor_class_long.cc +++ b/src/accessor/grib_accessor_class_long.cc @@ -51,7 +51,7 @@ int grib_accessor_long_t::unpack_string(char* v, size_t* len) l = strlen(repres) + 1; if (*len < l) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", cclass_name, name_, l, *len); diff --git a/src/accessor/grib_accessor_class_mars_step.cc b/src/accessor/grib_accessor_class_mars_step.cc index 9fa1b3325..d27b7c371 100644 --- a/src/accessor/grib_accessor_class_mars_step.cc +++ b/src/accessor/grib_accessor_class_mars_step.cc @@ -57,7 +57,7 @@ int grib_accessor_mars_step_t::unpack_string(char* val, size_t* len) size_t buflen = 100; long step; grib_accessor* stepRangeAcc = grib_find_accessor(grib_handle_of_accessor(this), stepRange_); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); if (!stepRangeAcc) { grib_context_log(context_, GRIB_LOG_ERROR, "%s: %s not found", cclass_name, stepRange_); diff --git a/src/accessor/grib_accessor_class_md5.cc b/src/accessor/grib_accessor_class_md5.cc index 0529ffaba..cc3f387be 100644 --- a/src/accessor/grib_accessor_class_md5.cc +++ b/src/accessor/grib_accessor_class_md5.cc @@ -88,7 +88,7 @@ int grib_accessor_md5_t::unpack_string(char* v, size_t* len) struct grib_md5_state md5c; if (*len < 32) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %d bytes long (len=%zu)", cclass_name, name_, 32, *len); diff --git a/src/accessor/grib_accessor_class_message.cc b/src/accessor/grib_accessor_class_message.cc index 1a1ff218c..86b3c25fa 100644 --- a/src/accessor/grib_accessor_class_message.cc +++ b/src/accessor/grib_accessor_class_message.cc @@ -34,7 +34,7 @@ void grib_accessor_message_t::update_size(size_t new_size) void grib_accessor_message_t::resize(size_t new_size) { - grib_context_log(context_, GRIB_LOG_FATAL, "%s %s: Not supported", class_name_, __func__); + grib_context_log(context_, GRIB_LOG_FATAL, "%s %s: Not supported", getClassName().get().c_str(), __func__); // void* zero = grib_context_malloc_clear(context_ , new_size); // grib_buffer_replace(a, (const unsigned char*)zero, new_size, 1, 0); @@ -59,7 +59,7 @@ int grib_accessor_message_t::unpack_string(char* val, size_t* len) if (*len < l) { grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - class_name_, name_, l, *len); + getClassName().get().c_str(), name_, l, *len); *len = l; return GRIB_BUFFER_TOO_SMALL; } diff --git a/src/accessor/grib_accessor_class_offset_file.cc b/src/accessor/grib_accessor_class_offset_file.cc index bc7991261..ac891b8da 100644 --- a/src/accessor/grib_accessor_class_offset_file.cc +++ b/src/accessor/grib_accessor_class_offset_file.cc @@ -34,7 +34,7 @@ int grib_accessor_offset_file_t::unpack_string(char* v, size_t* len) 0, }; int err = 0; - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); err = unpack_double(&val, &l); if (err) return err; diff --git a/src/accessor/grib_accessor_class_optimal_step_units.cc b/src/accessor/grib_accessor_class_optimal_step_units.cc index 0a142e06c..868cd258f 100644 --- a/src/accessor/grib_accessor_class_optimal_step_units.cc +++ b/src/accessor/grib_accessor_class_optimal_step_units.cc @@ -45,7 +45,7 @@ int grib_accessor_optimal_step_units_t::pack_expression(grib_expression* e) long lval = 0; size_t len = 1; grib_handle* hand = grib_handle_of_accessor(this); - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); if (strcmp(e->cclass->name, "long") == 0) { grib_expression_evaluate_long(hand, e, &lval); /* TODO: check return value */ diff --git a/src/accessor/grib_accessor_class_padding.cc b/src/accessor/grib_accessor_class_padding.cc index 26908bd56..b0a8453b3 100644 --- a/src/accessor/grib_accessor_class_padding.cc +++ b/src/accessor/grib_accessor_class_padding.cc @@ -41,7 +41,7 @@ void grib_accessor_padding_t::resize(size_t new_size) grib_context_log(context_, GRIB_LOG_DEBUG, "grib_accessor_padding::resize new_size=%zu length_ =%ld %s %s", - new_size, length_, class_name_, name_); + new_size, length_, getClassName().get().c_str(), name_); Assert(new_size == length_); } diff --git a/src/accessor/grib_accessor_class_proj_string.cc b/src/accessor/grib_accessor_class_proj_string.cc index d691823b6..228e29434 100644 --- a/src/accessor/grib_accessor_class_proj_string.cc +++ b/src/accessor/grib_accessor_class_proj_string.cc @@ -227,7 +227,7 @@ int grib_accessor_proj_string_t::unpack_string(char* v, size_t* len) size_t l = 100; // Safe bet if (*len < l) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is at least %zu bytes long (len=%zu)", cclass_name, name_, l, *len); diff --git a/src/accessor/grib_accessor_class_time.cc b/src/accessor/grib_accessor_class_time.cc index 5a9ca54ea..d1339da26 100644 --- a/src/accessor/grib_accessor_class_time.cc +++ b/src/accessor/grib_accessor_class_time.cc @@ -69,7 +69,7 @@ int grib_accessor_time_t::pack_long(const long* val, size_t* len) if (!is_time_valid(v)) { // ECC-1777: For now just a warning. Will later change to an error fprintf(stderr, "ECCODES WARNING : %s:%s: Time is not valid! hour=%ld min=%ld sec=%ld\n", - class_name_, __func__, hour, minute, second); + getClassName().get().c_str(), __func__, hour, minute, second); // return GRIB_ENCODING_ERROR; } @@ -97,7 +97,7 @@ int grib_accessor_time_t::unpack_string(char* val, size_t* len) if (*len < lmin) { grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - class_name_, name_, lmin, *len); + getClassName().get().c_str(), name_, lmin, *len); *len = lmin; return GRIB_BUFFER_TOO_SMALL; } diff --git a/src/accessor/grib_accessor_class_to_integer.cc b/src/accessor/grib_accessor_class_to_integer.cc index 2904563bd..a043ecf62 100644 --- a/src/accessor/grib_accessor_class_to_integer.cc +++ b/src/accessor/grib_accessor_class_to_integer.cc @@ -66,7 +66,7 @@ int grib_accessor_to_integer_t::unpack_string(char* val, size_t* len) size_t length = string_length(); if (*len < length + 1) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", cclass_name, name_, length + 1, *len); diff --git a/src/accessor/grib_accessor_class_to_string.cc b/src/accessor/grib_accessor_class_to_string.cc index e13581b2d..63c0f9bcb 100644 --- a/src/accessor/grib_accessor_class_to_string.cc +++ b/src/accessor/grib_accessor_class_to_string.cc @@ -64,7 +64,7 @@ int grib_accessor_to_string_t::unpack_string(char* val, size_t* len) size_t length = string_length(); if (*len < length + 1) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", cclass_name, name_, length + 1, *len); diff --git a/src/accessor/grib_accessor_class_validity_time.cc b/src/accessor/grib_accessor_class_validity_time.cc index 06d6999ca..1277e6778 100644 --- a/src/accessor/grib_accessor_class_validity_time.cc +++ b/src/accessor/grib_accessor_class_validity_time.cc @@ -98,7 +98,7 @@ int grib_accessor_validity_time_t::unpack_string(char* val, size_t* len) if (err) return err; if (*len < lmin) { - const char* cclass_name = class_name_; + const char* cclass_name = getClassName().get().c_str(); grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", cclass_name, name_, lmin, *len); diff --git a/src/accessor/grib_accessor_class_variable.cc b/src/accessor/grib_accessor_class_variable.cc index a4ae57320..2b5173e0c 100644 --- a/src/accessor/grib_accessor_class_variable.cc +++ b/src/accessor/grib_accessor_class_variable.cc @@ -227,7 +227,7 @@ int grib_accessor_variable_t::unpack_string(char* val, size_t* len) if (*len < slen) { grib_context_log(context_, GRIB_LOG_ERROR, "%s: Buffer too small for %s. It is %zu bytes long (len=%zu)", - class_name_, name_, slen, *len); + getClassName().get().c_str(), name_, slen, *len); *len = slen; return GRIB_BUFFER_TOO_SMALL; } diff --git a/src/grib_accessor_class.cc b/src/grib_accessor_class.cc index 94d140b2b..d19aa48aa 100644 --- a/src/grib_accessor_class.cc +++ b/src/grib_accessor_class.cc @@ -194,7 +194,7 @@ grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator, else { grib_context_log(p->h->context, GRIB_LOG_DEBUG, "CREATE: name=%s class=%s offset=%ld length=%ld action=", - a->name_, a->class_name_, a->offset_, a->length_); + a->name_, a->getClassName().get().c_str(), a->offset_, a->length_); grib_grow_buffer(p->h->context, p->h->buffer, size); p->h->buffer->ulength = size; diff --git a/src/grib_dumper_class_serialize.cc b/src/grib_dumper_class_serialize.cc index 11844997e..ed505fa7b 100644 --- a/src/grib_dumper_class_serialize.cc +++ b/src/grib_dumper_class_serialize.cc @@ -105,7 +105,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags_ & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0 && (d->option_flags & GRIB_DUMP_FLAG_READ_ONLY) == 0 && - (strcmp(a->class_name_, "lookup") != 0)) + (strcmp(a->getClassName().get().c_str(), "lookup") != 0)) return; if (((a->flags_ & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0) && (value == GRIB_MISSING_LONG)) @@ -114,7 +114,7 @@ static void dump_long(grib_dumper* d, grib_accessor* a, const char* comment) fprintf(self->dumper.out, "%s = %ld", a->name_, value); if (((a->flags_ & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) && - (strcmp(a->class_name_, "lookup") != 0)) + (strcmp(a->getClassName().get().c_str(), "lookup") != 0)) fprintf(self->dumper.out, " (read_only)"); //if(comment) fprintf(self->dumper.out," [%s]",comment); diff --git a/src/grib_value.cc b/src/grib_value.cc index 4b5b71ec7..b786bcb65 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -681,7 +681,7 @@ int grib_accessor_can_be_missing(grib_accessor* a, int* err) if (a->flags_ & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) { return 1; } - if (STR_EQUAL(a->class_name_, "codetable")) { + if (STR_EQUAL(a->getClassName().get().c_str(), "codetable")) { // Special case of Code Table keys // The vast majority have a 'Missing' entry return 1; diff --git a/tools/grib_compare.cc b/tools/grib_compare.cc index 4e984ac1c..ace60f296 100644 --- a/tools/grib_compare.cc +++ b/tools/grib_compare.cc @@ -647,7 +647,7 @@ static int test_bit(long a, long b) /* If the accessor represents a codeflag key, then return its binary rep in 'result' */ static int codeflag_to_bitstr(grib_accessor* a, long val, char* result) { - if (a && grib_inline_strcmp(a->class_name_, "codeflag") == 0) { + if (a && grib_inline_strcmp(a->getClassName().get().c_str(), "codeflag") == 0) { long i; const long bytelen = a->length_ * 8; for (i = 0; i < bytelen; i++) {