Closed nickhuangxinyu closed 2 years ago
You can enumerate groups the same way you enumerate lists and arrays, using config_setting_length() and config_setting_get_elem(). Or operator[] in C++.
can you provide a demo code? my config is:
dict = {
key1="a";
key2="b";
};
how to enumerate the dict without knowing key1 and key2? thanks very much!! @hyperrealm
const Setting &dict = cfg.lookup("dict"); for (int i = 0; i < dict.getLength(); ++i) { const Setting &child = dict[i]; // child.getName() is the key }
examples/c++/example1.cpp has an example of exactly this
can i enumerate keys for dict (it's key1 and key2)?
i know this can be implemented by:
but this seems be wired, can you add the enumerate method in next version?