How to set JSON_TYPE in 2.0.65

nrgyzer nrgyzer at gmail.com
Mon Mar 31 11:59:00 PDT 2014


Hi guys,

I updated my dmd version from 2.0.63 to 2.0.65 and having some 
trouble with my JSON-definitions. The code below worked in 2.0.63 
but not in 2.0.65:

JSONValue oJson = JSONValue();
oJson.type = JSON_TYPE.OBJECT; // FAILS
oJson.object["myEntry"] = JSONValue();
oJson.object["myEntry"].type = JSON_TYPE.STRING; // FAILS
oJSon.object["myEntry"].str = "MyText";

Since the type property is a constant in 2.0.65, I've no idea how 
I can set the type for my JSON entries. I already tried the 
following:

JSONValue oJson = JSONValue(JSON_TYPE.OBJECT);
oJson.object["myEntry"] = JSONValue(JSON_TYPE.STRING);
oJSon.object["myEntry"].str = "MyText";

But this gives me something like: "JSONValue is not an object".

Any idea how I can set the corresponding value type?


More information about the Digitalmars-d-learn mailing list