C# 클래스 Poonya.Utils.Json

Provides functions for encoding and decoding files in the JSON format.
파일 보기 프로젝트 열기: sunag/sea3d

공개 메소드들

메소드 설명
Decode ( byte sjson ) : object

Decodes a JSON bytestream into a hash table with numbers, bools, strings, ArrayLists and Hashtables.

Encode ( object t ) : string

Encodes the hashtable t in the JSON format. The hash table can contain, numbers, bools, strings, ArrayLists and Hashtables.

Load ( string path ) : Hashtable

Convenience function for loading a file.

Save ( Hashtable h, string path ) : void

Convenience function for saving a file.

Write ( object o, StringBuilder builder, int indentation ) : void

Writes a generic object.

WriteArray ( System.Collections.ArrayList a, StringBuilder builder, int indentation ) : void

Writes an array of items.

WriteNewLine ( StringBuilder builder, int indentation ) : void

Writes a newline and the desired ammount of indentation.

WriteObject ( System.Collections.Hashtable t, StringBuilder builder, int indentation ) : void

Writes a JSON object.

WriteObjectField ( System.Collections.Hashtable t, string key, bool write_comma, StringBuilder builder, int indentation ) : void

Writes a particular field in a JSON object.

WriteObjectFields ( System.Collections.Hashtable t, StringBuilder builder, int indentation ) : void

Writes all the fields of a JSON object.

WriteString ( String s, StringBuilder builder ) : void

Writes a string.

비공개 메소드들

메소드 설명
AtEnd ( byte json, int &index ) : bool
Consume ( byte json, int &index, String consume ) : void
Next ( byte json, int &index ) : byte
Parse ( byte json, int &index ) : object
ParseArray ( byte json, int &index ) : ArrayList
ParseBinary ( byte json, int &index ) : byte[]
ParseNumber ( byte json, int &index ) : Double
ParseObject ( byte json, int &index ) : Hashtable
ParseString ( byte json, int &index ) : String
SkipWhitespace ( byte json, int &index ) : void

메소드 상세

Decode() 공개 정적인 메소드

Decodes a JSON bytestream into a hash table with numbers, bools, strings, ArrayLists and Hashtables.
public static Decode ( byte sjson ) : object
sjson byte
리턴 object

Encode() 공개 정적인 메소드

Encodes the hashtable t in the JSON format. The hash table can contain, numbers, bools, strings, ArrayLists and Hashtables.
public static Encode ( object t ) : string
t object
리턴 string

Load() 공개 정적인 메소드

Convenience function for loading a file.
public static Load ( string path ) : Hashtable
path string
리턴 Hashtable

Save() 공개 정적인 메소드

Convenience function for saving a file.
public static Save ( Hashtable h, string path ) : void
h Hashtable
path string
리턴 void

Write() 공개 정적인 메소드

Writes a generic object.
public static Write ( object o, StringBuilder builder, int indentation ) : void
o object
builder StringBuilder
indentation int
리턴 void

WriteArray() 공개 정적인 메소드

Writes an array of items.
public static WriteArray ( System.Collections.ArrayList a, StringBuilder builder, int indentation ) : void
a System.Collections.ArrayList
builder StringBuilder
indentation int
리턴 void

WriteNewLine() 공개 정적인 메소드

Writes a newline and the desired ammount of indentation.
public static WriteNewLine ( StringBuilder builder, int indentation ) : void
builder StringBuilder
indentation int
리턴 void

WriteObject() 공개 정적인 메소드

Writes a JSON object.
public static WriteObject ( System.Collections.Hashtable t, StringBuilder builder, int indentation ) : void
t System.Collections.Hashtable
builder StringBuilder
indentation int
리턴 void

WriteObjectField() 공개 정적인 메소드

Writes a particular field in a JSON object.
public static WriteObjectField ( System.Collections.Hashtable t, string key, bool write_comma, StringBuilder builder, int indentation ) : void
t System.Collections.Hashtable
key string
write_comma bool
builder StringBuilder
indentation int
리턴 void

WriteObjectFields() 공개 정적인 메소드

Writes all the fields of a JSON object.
public static WriteObjectFields ( System.Collections.Hashtable t, StringBuilder builder, int indentation ) : void
t System.Collections.Hashtable
builder StringBuilder
indentation int
리턴 void

WriteString() 공개 정적인 메소드

Writes a string.
public static WriteString ( String s, StringBuilder builder ) : void
s String
builder StringBuilder
리턴 void