protected static Hashtable parseObject(char[] json, ref int index) { Hashtable hashtable = new Hashtable(); MiniJSON.nextToken(json, ref index); bool flag = false; while (!flag) { int num = MiniJSON.lookAhead(json, index); if (num == 0) { return(null); } if (num == 6) { MiniJSON.nextToken(json, ref index); } else { if (num == 2) { MiniJSON.nextToken(json, ref index); return(hashtable); } string text = MiniJSON.parseString(json, ref index); if (text == null) { return(null); } num = MiniJSON.nextToken(json, ref index); if (num != 5) { return(null); } bool flag2 = true; object value = MiniJSON.parseValue(json, ref index, ref flag2); if (!flag2) { return(null); } hashtable[text] = value; } } return(hashtable); }
public static object jsonDecode(string json) { MiniJSON.lastDecode = json; if (json != null) { char[] json2 = json.ToCharArray(); int num = 0; bool flag = true; object result = MiniJSON.parseValue(json2, ref num, ref flag); if (flag) { MiniJSON.lastErrorIndex = -1; } else { MiniJSON.lastErrorIndex = num; } return(result); } return(null); }
protected static ArrayList parseArray(char[] json, ref int index) { ArrayList arrayList = new ArrayList(); MiniJSON.nextToken(json, ref index); bool flag = false; while (!flag) { int num = MiniJSON.lookAhead(json, index); if (num == 0) { return(null); } if (num == 6) { MiniJSON.nextToken(json, ref index); } else { if (num == 4) { MiniJSON.nextToken(json, ref index); break; } bool flag2 = true; object value = MiniJSON.parseValue(json, ref index, ref flag2); if (!flag2) { return(null); } arrayList.Add(value); } } return(arrayList); }