Example #1
0
 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());
 }
Example #2
0
        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());
        }
Example #3
0
        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);
            }
        }
Example #4
0
 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);
 }