C# Class XSerializer.JsonReader

Inheritance: IDisposable
显示文件 Open project: QuickenLoans/XSerializer Class Usage Examples

Private Properties

Property Type Description
IsWhitespace bool
ReadCurrent int
ReadEscapedChar char
ReadLiteral void
ReadNumber string
ReadWhitespace string
TryReadString bool

Public Methods

Method Description
Discard ( string path ) : void

Read and discard the next content value. If the next content type is JsonNodeType.OpenObject or JsonNodeType.OpenArray, then the reader will continue to read and discard content until the matching JsonNodeType.CloseObject or JsonNodeType.CloseArray content type is found. For all other content types, no additional reads are made.

Dispose ( ) : void
JsonReader ( TextReader reader, IJsonSerializeOperationInfo info ) : System
PeekContent ( ) : JsonNodeType

Reads the next non-whitespace node type without changing the state of the reader. If the next node type is whitespace, then all leading whitespace is consumed and discarded. The next node type is then returned, again without changing the state of the reader.

Read ( string path ) : bool

Reads the next node from the stream.

ReadContent ( string path ) : bool

Reads the next non-whitespace node from the stream.

ReadProperties ( string path ) : IEnumerable

Read the properties of a json object. The resulting collection contains the name of each property. As the collection is enumerated, for each property name, the reader is positioned at the beginning of the property's value. The caller is expected to parse the value, calling Read or ReadContent one or more times, before continuing to enumerate the collection.

SetDecryptReads ( bool value, string path ) : void

Private Methods

Method Description
IsWhitespace ( int c ) : bool
ReadCurrent ( ) : int
ReadEscapedChar ( ) : char
ReadLiteral ( string path, string value ) : void
ReadNumber ( char c ) : string
ReadWhitespace ( char first ) : string
TryReadString ( object &value, JsonNodeType &nodeType ) : bool

Method Details

Discard() public method

Read and discard the next content value. If the next content type is JsonNodeType.OpenObject or JsonNodeType.OpenArray, then the reader will continue to read and discard content until the matching JsonNodeType.CloseObject or JsonNodeType.CloseArray content type is found. For all other content types, no additional reads are made.
public Discard ( string path ) : void
path string
return void

Dispose() public method

public Dispose ( ) : void
return void

JsonReader() public method

public JsonReader ( TextReader reader, IJsonSerializeOperationInfo info ) : System
reader TextReader
info IJsonSerializeOperationInfo
return System

PeekContent() public method

Reads the next non-whitespace node type without changing the state of the reader. If the next node type is whitespace, then all leading whitespace is consumed and discarded. The next node type is then returned, again without changing the state of the reader.
public PeekContent ( ) : JsonNodeType
return JsonNodeType

Read() public method

Reads the next node from the stream.
public Read ( string path ) : bool
path string
return bool

ReadContent() public method

Reads the next non-whitespace node from the stream.
public ReadContent ( string path ) : bool
path string
return bool

ReadProperties() public method

Read the properties of a json object. The resulting collection contains the name of each property. As the collection is enumerated, for each property name, the reader is positioned at the beginning of the property's value. The caller is expected to parse the value, calling Read or ReadContent one or more times, before continuing to enumerate the collection.
If the JSON object is malformed.
public ReadProperties ( string path ) : IEnumerable
path string /// The path to the current object. Used for error reporting. ///
return IEnumerable

SetDecryptReads() public method

public SetDecryptReads ( bool value, string path ) : void
value bool
path string
return void