/// <summary> /// Reads a JSON object from the given string. /// </summary> /// <param name="str">the string that contains the JSON object</param> /// <returns>the JSON object that has been read</returns> /// <exception cref="ParseException">if the input is not valid JSON</exception> /// <exception cref="NotSupportedException">if the input does not contain a JSON object</exception> public static new JsonObject readFrom(string str) { return(JsonValue.readFrom(str).asObject()); }
/// <summary> /// Reads a JSON array from the given string. /// </summary> /// <param name="str">the string that contains the JSON array</param> /// <returns>the JSON array that has been read</returns> /// <exception cref="ParseException">if the input is not valid JSON</exception> /// <exception cref="NotSupportedException">if the input does not contain a JSON array</exception> public static new JsonArray readFrom(string str) { return(JsonValue.readFrom(str).asArray()); }
/* * public JsonValue this[string name] * { * get { return values[name]; } * set { values[name] = value; } * } */ /// <summary> /// Reads a JSON object from the given reader. /// Characters are read in chunks and buffered internally, therefore wrapping an existing reader in an additional BufferedReader does not improve reading performance. /// </summary> /// <param name="reader">the reader to read the JSON object from</param> /// <returns>the JSON object that has been read</returns> /// <exception cref="ParseException">if the input is not valid JSON</exception> /// <exception cref="NotSupportedException">if the input does not contain a JSON object</exception> public static new JsonObject readFrom(TextReader reader) { return(JsonValue.readFrom(reader).asObject()); }
/// <summary> /// Reads a JSON array from the given reader. /// Characters are read in chunks and buffered internally, therefore wrapping an existing reader in an additional BufferedReader does not improve reading performance. /// </summary> /// <param name="reader">the reader to read the JSON array from</param> /// <returns>the JSON array that has been read</returns> /// <exception cref="ParseException">if the input is not valid JSON</exception> /// <exception cref="NotSupportedException">if the input does not contain a JSON array</exception> public static new JsonArray readFrom(TextReader reader) { return(JsonValue.readFrom(reader).asArray()); }