Can I get objects by name with libjson?
I have installed libjson. I am surprised there is no way to get values by object name. I will have to write my own functions or am I missing something?
Can I get objects by name with libjson?
I have installed libjson. I am surprised there is no way to get values by object name. I will have to write my own functions or am I missing something?
If you are using the C++ library, the JSONNode class overloads the [] operator.
Per the docs:
JSONNode & operator [] (const json_string & name);
const JSONNode & operator [] (const json_string & name) const;
This will give you a reference to a child node either at a specific location or by it’s name. Asking for a
node that is not there will result in undefined behavior.