C# Class Json.Serialization.JsonFormatter

JSON formatter class for .NET Micro Framework
Can be used to serialize/deserialize with JSON.
Mostrar archivo Open project: devicehive/devicehive-.net-mf Class Usage Examples

Public Methods

Method Description
FromJson ( byte bts, Type objType ) : object

Deserializes an object from JSON

This function can be used to parse JSON objecta and arrays.

JsonFormatter ( ) : System

Constructs a JSON formatter

ToJson ( object o ) : string

Serializes an object to a string

Object definition must have the [Serializable] attribute. Serializes only members which are not marked with [NonSerialized] attribute.

Private Methods

Method Description
GetNextQuotedString ( string s, int &pos ) : string

Returns nets parameter string

GetSubObject ( string s, int &pos ) : string

Returns next sub-object string

GetValueString ( string s, int &pos ) : string

Extracts a value from a given string

ParseObject ( string JsonString, Type objType ) : object

Parses object from JSON

Works recursively.

SplitArrayStrings ( string s ) : ArrayList

Splits a sprecified string in parts according to JSON array definition

Method Details

FromJson() public method

Deserializes an object from JSON
This function can be used to parse JSON objecta and arrays.
public FromJson ( byte bts, Type objType ) : object
bts byte JSON input bytes
objType System.Type type of an object to deserialize
return object

JsonFormatter() public method

Constructs a JSON formatter
public JsonFormatter ( ) : System
return System

ToJson() public method

Serializes an object to a string
Object definition must have the [Serializable] attribute. Serializes only members which are not marked with [NonSerialized] attribute.
public ToJson ( object o ) : string
o object Object to be serialized
return string