示例#1
0
			public static object Parse(string jsonString) {
				using (var instance = new Parser(jsonString)) {
					return instance.ParseValue();
				}
			}
        /// <summary>
        /// Parses the string json into a value
        /// </summary>
        /// <param name="json">A JSON string.</param>
        /// <returns>An List&lt;object&gt;, a Dictionary&lt;string, object&gt;, a double, an integer,a string, null, true, or false</returns>
        public static object Deserialize(string json)
        {
            // save the string for debug information
            if (json == null)
                return null;

            var parser = new Parser(json);
            return parser.Parse();
        }
示例#3
0
 public static string GetStringDecode(string encodeStr)
 {
     using (var instance = new Parser(encodeStr)) {
         return instance.ParseString();
     }
 }
        public static List<object> DeserializeArrayNoRecursion(string json)
        {
            if (json == null)
            {
                return null;
            } else if (json == "" || json == "[]")
            {
                return new List<object>(0);
            }

            Parser parser = new Parser(json);
            return parser.ParseArrayOnly();
        }