C# Class NetServ.Net.Json.JsonParser

Provided support for parsing JavaScript Object Notation data types from an underlying System.IO.TextReader.
Inheritance: Disposable
Mostra file Open project: appcelerator/entourage Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Closes this parser.

JsonParser ( TextReader rdr, bool ownsReader ) : System

Initialises a new instance of the JsonParser class and specifies the source System.IO.TextReader and a value indicating if the instance owns the specified TextReader.

NextToken ( ) : TokenType

Classifies the next token on the underlying stream.

ParseArray ( ) : JsonArray

Parses a NetServ.Net.Json.JsonArray and all contained types from the underlying stream.

ParseBoolean ( ) : JsonBoolean

Parses a NetServ.Net.Json.JsonBoolean from the underlying stream.

ParseNext ( ) : IJsonType

Parses the next type from the underlying stream.

ParseNext ( TokenType type ) : IJsonType

Parses the specified type from the underlying stream.

ParseNull ( ) : JsonNull

Parses a NetServ.Net.Json.JsonNull from the underlying stream.

ParseNumber ( ) : JsonNumber

Parses a NetServ.Net.Json.JsonNumber from the underlying stream.

ParseObject ( ) : JsonObject

Parses a NetServ.Net.Json.JsonObject and all contained types from the underlying stream.

ParseString ( ) : JsonString

Parses a NetServ.Net.Json.JsonString from the underlying stream.

Protected Methods

Method Description
AssertDepth ( int depth ) : void

Asserts that the specified depth does not exceed P:NetServ.Net.Json.JsonParser.MaximumDepth. If the depth has been exceeded, a System.FormatException is thrown.

Dispose ( bool disposing ) : void

Disposed of this instance.

Peek ( ) : int

Peeks at and returns a single character from the underlying stream.

Peek ( bool skipWhite ) : int

Peeks at the next character from the underlying stream and specifies a value which indicates whether white space characters should be advanced over.

Read ( ) : int

Reads and returns a single character from the underlying stream.

Read ( bool skipWhite ) : int

Reads the next character from the underlying stream and specified a value which indicates whether white space characters should be skipped.

Private Methods

Method Description
AssertNext ( TokenType type ) : void
FromHex ( int ch ) : int
IsNumberComponent ( int ch ) : bool
Match ( string value ) : bool
ParseStringImpl ( ) : string
ParseUnicode ( ) : char

Method Details

AssertDepth() protected method

Asserts that the specified depth does not exceed P:NetServ.Net.Json.JsonParser.MaximumDepth. If the depth has been exceeded, a System.FormatException is thrown.
protected AssertDepth ( int depth ) : void
depth int The depth.
return void

Close() public method

Closes this parser.
public Close ( ) : void
return void

Dispose() protected method

Disposed of this instance.
protected Dispose ( bool disposing ) : void
disposing bool True if being called explicitly, otherwise; false /// to indicate being called implicitly by the GC.
return void

JsonParser() public method

Initialises a new instance of the JsonParser class and specifies the source System.IO.TextReader and a value indicating if the instance owns the specified TextReader.
public JsonParser ( TextReader rdr, bool ownsReader ) : System
rdr TextReader The underlying TextReader.
ownsReader bool True if this instance owns the TextReader, otherwise; /// false.
return System

NextToken() public method

Classifies the next token on the underlying stream.
public NextToken ( ) : TokenType
return TokenType

ParseArray() public method

Parses a NetServ.Net.Json.JsonArray and all contained types from the underlying stream.
public ParseArray ( ) : JsonArray
return JsonArray

ParseBoolean() public method

Parses a NetServ.Net.Json.JsonBoolean from the underlying stream.
public ParseBoolean ( ) : JsonBoolean
return JsonBoolean

ParseNext() public method

Parses the next type from the underlying stream.
public ParseNext ( ) : IJsonType
return IJsonType

ParseNext() public method

Parses the specified type from the underlying stream.
public ParseNext ( TokenType type ) : IJsonType
type TokenType The type to parse.
return IJsonType

ParseNull() public method

Parses a NetServ.Net.Json.JsonNull from the underlying stream.
public ParseNull ( ) : JsonNull
return JsonNull

ParseNumber() public method

Parses a NetServ.Net.Json.JsonNumber from the underlying stream.
public ParseNumber ( ) : JsonNumber
return JsonNumber

ParseObject() public method

Parses a NetServ.Net.Json.JsonObject and all contained types from the underlying stream.
public ParseObject ( ) : JsonObject
return JsonObject

ParseString() public method

Parses a NetServ.Net.Json.JsonString from the underlying stream.
public ParseString ( ) : JsonString
return JsonString

Peek() protected method

Peeks at and returns a single character from the underlying stream.
protected Peek ( ) : int
return int

Peek() protected method

Peeks at the next character from the underlying stream and specifies a value which indicates whether white space characters should be advanced over.
protected Peek ( bool skipWhite ) : int
skipWhite bool True to skip white space characters, otherwise; false.
return int

Read() protected method

Reads and returns a single character from the underlying stream.
protected Read ( ) : int
return int

Read() protected method

Reads the next character from the underlying stream and specified a value which indicates whether white space characters should be skipped.
protected Read ( bool skipWhite ) : int
skipWhite bool True to skip white space characters, otherwise; false.
return int