static void Main(string[] args) { SharpJSON sjson = new SharpJSON("{'val':12.009,'x':'d','a':['a','a','v', 12.31, 0.231, 12321.,'string',{'b': ' dsa', 'c' : [false, true, null, {'a':true}]}],'b':'text','c':{'x':['a',{'x':['d',{'c':['aa',]}]}]}}"); string x = ""; sjson.get("b", ref x); double v = 0.0; sjson.get("val", ref v); System.Console.Out.Write(v); System.Console.Out.Write(new SharpJSON(sjson.dump()).dump()); }
static void Main(string[] args) { SharpJSON sjson = new SharpJSON("{'val':12.009,'x':'d','a':['a','a','v', 12.31, 0.231, 12321.,'string',{'b': ' dsa', 'c' : [false, true, null, {'a':true}]}],'b':'text','c':{'x':['a',{'x':['d',{'c':['aa',]}]}]}}"); string x = ""; sjson.get("b", ref x); double v = 0.0; sjson.get("val", ref v); System.Console.Out.Write(v); System.Console.Out.Write(new SharpJSON(sjson.dump()).dump()); }
public void get(string key_str, ref SharpJSON sj) { JSONObject obj = (JSONObject)json; JSONValue val = ((JSONObject)obj.get(new JSONString(key_str))).val; string str = ""; if (val is JSONArray) { str = dumpArray((JSONArray)val); } if (val is JSONObject) { str = dumpObject((JSONObject)val) sj = new SharpJSON(str); } }
public void get(string key_str, ref SharpJSON sj) { JSONObject obj = (JSONObject)json; JSONValue val = ((JSONObject)obj.get(new JSONString(key_str))).val; string str = ""; if (val is JSONArray) str = dumpArray((JSONArray)val); if (val is JSONObject) str = dumpObject((JSONObject)val) sj = new SharpJSON(str); }