JSONConfiguration in 1.5.2

Please post support and help requests here.
Posts: 2
Joined: 26 Feb 2014, 20:15

JSONConfiguration in 1.5.2

Postby vikascoder » 26 Feb 2014, 20:24

Is it a known problem that it is impossible to replace an item in a JSON Array (e.g. in a .json file) using Poco/Util/JSONConfiguration API? It only appends to the array.

Code: Select all

// sample json file
  "config" : {
    "some_array_values" : [
    "prop1" : "changed"

// Access syntax via JSONConfiguration
AutoPtr<JSONConfiguration> jsonConf( new JSONConfiguration(json_config_path) );
int number_test = jsonConf->getInt("config.some_array_values[1]");  // Returns 1

// Replace this value with a new one
jsonConf->setInt("config.some_array_values[1]", 99);  // Doesn't replaces, simply appends the value to the end of the array??

Is this supposed to work at all with this syntax in the present and future builds? Internally the JSON Array interface only has an add function which appends values.

Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests