stefanocasazza / ULib

C++ application development framework, to help developers create and deploy applications quickly and simply
GNU Lesser General Public License v3.0
947 stars 107 forks source link

Consume JSON Fields + Values in Place #61

Closed victorstewart closed 5 years ago

victorstewart commented 5 years ago

this allows consumption of a json document by field and value...

ex:

const UString workingString = U_STRING_FROM_CONSTANT("{\"ABC\":{\"eventKey\":0,\"eventTime\":18212931298},\"XYZ\":{\"eventKey\":1,\"eventTime\":1111131298}}");

UValue::consumeFieldsAndValues(workingString, [&] (const UString& field, const UString& value) -> void {

      printf("field = %s\nvalue = %s\n", field.c_str(), value.c_str());
   });