I am working with the example data from the library's documentation:
{
"names": {
"en": "Germany",
"de": "Deutschland"
},
"cities": [ "Berlin", "Frankfurt" ]
}
Say I call
MMDB_get_value(&result.entry, &entry_data, "names", NULL);
This will produce entry_data.type == 7, which is a MAP, as expected. How can I then retrieve the values for specific keys in this map? Because entry_data is a MMDB_entry_data_s and NOT a MMDB_entry_s, I cannot pass it into MMDB_get_value.
Same question would apply for an array:
MMDB_get_value(&result.entry, &entry_data, "cities", NULL);
This will produce with entry_data.type == 11, which is an ARRAY, as expected. How can I then retrieve the values for specific positions in this array?
I am working with the example data from the library's documentation:
{ "names": { "en": "Germany", "de": "Deutschland" }, "cities": [ "Berlin", "Frankfurt" ] }Say I call
This will produce
entry_data.type == 7, which is a MAP, as expected. How can I then retrieve the values for specific keys in this map? Becauseentry_datais aMMDB_entry_data_sand NOT aMMDB_entry_s, I cannot pass it intoMMDB_get_value.Same question would apply for an array:
This will produce with
entry_data.type == 11, which is an ARRAY, as expected. How can I then retrieve the values for specific positions in this array?