C# Class JsonLD.Util.JSONUtils

A bunch of functions to make loading JSON easy
显示文件 Open project: NuGet/json-ld.net

Public Methods

Method Description
FromInputStream ( Stream content ) : JToken
FromInputStream ( Stream content, string enc ) : JToken
FromReader ( TextReader r ) : JToken
FromString ( string jsonString ) : JToken
FromURL ( Uri url ) : JToken

Returns a Map, List, or String containing the contents of the JSON resource resolved from the URL.

Returns a Map, List, or String containing the contents of the JSON resource resolved from the URL.

ToPrettyString ( JToken obj ) : string
ToString ( JToken obj ) : string
Write ( TextWriter w, JToken jsonObject ) : void
WritePrettyPrint ( TextWriter w, JToken jsonObject ) : void

Private Methods

Method Description
JSONUtils ( ) : System

Method Details

FromInputStream() public static method

public static FromInputStream ( Stream content ) : JToken
content Stream
return JToken

FromInputStream() public static method

public static FromInputStream ( Stream content, string enc ) : JToken
content Stream
enc string
return JToken

FromReader() public static method

public static FromReader ( TextReader r ) : JToken
r System.IO.TextReader
return JToken

FromString() public static method

public static FromString ( string jsonString ) : JToken
jsonString string
return JToken

FromURL() public static method

Returns a Map, List, or String containing the contents of the JSON resource resolved from the URL.
Returns a Map, List, or String containing the contents of the JSON resource resolved from the URL.
If the JSON was not valid. /// If there was an error resolving the resource. ///
public static FromURL ( Uri url ) : JToken
url System.Uri The URL to resolve
return JToken

ToPrettyString() public static method

public static ToPrettyString ( JToken obj ) : string
obj JToken
return string

ToString() public static method

public static ToString ( JToken obj ) : string
obj JToken
return string

Write() public static method

public static Write ( TextWriter w, JToken jsonObject ) : void
w System.IO.TextWriter
jsonObject JToken
return void

WritePrettyPrint() public static method

public static WritePrettyPrint ( TextWriter w, JToken jsonObject ) : void
w System.IO.TextWriter
jsonObject JToken
return void