title: How can I get property name and property value from json-cpp parser?
body: <p>I'm using <strong>jsoncpp</strong> parser (<a href="http://jsoncpp.sourceforge.net" rel="nofollow noreferrer">http://jsoncpp.sourceforge.net</a>) to parse JSON data.
  So, if we have the following JSON:</p>
  <pre><code>{ &quot;name&quot;: &quot;Joseph&quot;, &quot;age&quot;: 20 }
  </code></pre>
  <p>How can I get the <strong>property name</strong> <em>name</em> and <strong>value</strong> <em>Joseph</em>, ... after age and 20?
  OK, we can do <strong>universally</strong> this:</p>
  <pre><code>string e = root.get(propertyName, defaultValue).asString();
  </code></pre>
  <p>But <strong>really</strong> what we want is something like this:</p>
  <pre><code>string e = root.get(name, &quot;Mark&quot;).asString();
  </code></pre>
  <p>Now, variable <strong>e</strong> is Joseph, it works. But I <strong>have</strong> to take/write &quot;<strong>name</strong>&quot;. I do not want to <strong>QUERY</strong> (without questioning the function I want to get <strong>&quot;name&quot;</strong> (name of property) and <strong>&quot;Joseph&quot;</strong> (value of property)).</p>
  <p>After it would be best to store in a <strong>field</strong> (C/C++ for example):</p>
  <pre><code>property[name][0] = &quot;Joseph&quot;
  property[age][0] = 20 
  </code></pre>
  <p>How can I do that? Or any other ideas?</p>