C# Class NetServ.Net.Json.JsonWriter

Provided support for writing JavaScript Object Notation data types to an underlying System.IO.TextWriter.
Inheritance: Disposable, IJsonWriter
Mostra file Open project: appcelerator/entourage Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Closes this writer.

JsonWriter ( ) : System

Initialises a new instance of then JsonWriter class using a System.IO.StringWriter as the underlying System.IO.TextWriter.

JsonWriter ( TextWriter writer, bool ownsWriter ) : System

Initialises a new instance of the JsonWriter class and specifies the underlying System.IO.TextWriter and a value indicating if the instance owns the specified TextWriter.

ToString ( ) : string

Returns a System.String representation of this instance.

WriteBeginArray ( ) : void

Writes the start of an array to the underlying data stream.

WriteBeginObject ( ) : void

Writes the start of an object to the underlying data stream.

WriteEndArray ( ) : void

Writes the end of an array to the underlying data stream.

WriteEndObject ( ) : void

Writes the end of an object to the underlying data stream.

WriteName ( string value ) : void

Writes a object property name to the underlying data stream.

WriteValue ( string value ) : void

Writes a raw string value to the underlying data stream.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Disposed of this instance.

PostWrite ( JsonTokenType token ) : void

Performs any post write operations needed after the specified token has been written to the underlying stream.

PreWrite ( JsonTokenType token ) : void

Performs any assertions and / or write operations needed before the specified token is written to the underlying stream.

Private Methods

Method Description
Assert ( bool cond, JsonTokenType nextToken ) : void
IsStructEnd ( JsonTokenType token ) : bool
IsStructStart ( JsonTokenType token ) : bool

Method Details

Close() public method

Closes this writer.
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

JsonWriter() public method

Initialises a new instance of then JsonWriter class using a System.IO.StringWriter as the underlying System.IO.TextWriter.
public JsonWriter ( ) : System
return System

JsonWriter() public method

Initialises a new instance of the JsonWriter class and specifies the underlying System.IO.TextWriter and a value indicating if the instance owns the specified TextWriter.
public JsonWriter ( TextWriter writer, bool ownsWriter ) : System
writer System.IO.TextWriter The underlying text writer.
ownsWriter bool True if this instance owns the specified TextWriter, /// otherwise; false.
return System

PostWrite() protected method

Performs any post write operations needed after the specified token has been written to the underlying stream.
protected PostWrite ( JsonTokenType token ) : void
token JsonTokenType The token written.
return void

PreWrite() protected method

Performs any assertions and / or write operations needed before the specified token is written to the underlying stream.
protected PreWrite ( JsonTokenType token ) : void
token JsonTokenType The next token to be written.
return void

ToString() public method

Returns a System.String representation of this instance.
public ToString ( ) : string
return string

WriteBeginArray() public method

Writes the start of an array to the underlying data stream.
public WriteBeginArray ( ) : void
return void

WriteBeginObject() public method

Writes the start of an object to the underlying data stream.
public WriteBeginObject ( ) : void
return void

WriteEndArray() public method

Writes the end of an array to the underlying data stream.
public WriteEndArray ( ) : void
return void

WriteEndObject() public method

Writes the end of an object to the underlying data stream.
public WriteEndObject ( ) : void
return void

WriteName() public method

Writes a object property name to the underlying data stream.
public WriteName ( string value ) : void
value string The property name.
return void

WriteValue() public method

Writes a raw string value to the underlying data stream.
public WriteValue ( string value ) : void
value string The string to write.
return void