C# 클래스 GA_MiniJSON, TheUnseen

This class encodes and decodes JSON strings. Spec. details, see http://www.json.org/ JSON uses Arrays and Objects. These correspond here to the datatypes ArrayList and Hashtable. All numbers are parsed to floats.
파일 보기 프로젝트 열기: henryj41043/TheUnseen 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
instance GA_MiniJSON,
lastDecode string
lastErrorIndex int

공개 메소드들

메소드 설명
GetLastErrorIndex ( ) : int

On decoding, this function returns the position at which the parse failed (-1 = no error).

GetLastErrorSnippet ( ) : string

If a decoding error occurred, this function returns a piece of the JSON string at which the error took place. To ease debugging.

JsonDecode ( string json ) : object

Parses the string json into a value

JsonEncode ( object json ) : string

Converts a Hashtable / ArrayList object into a JSON string

LastDecodeSuccessful ( ) : bool

On decoding, this function returns the position at which the parse failed (-1 = no error).

보호된 메소드들

메소드 설명
EatWhitespace ( char json, int &index ) : void
GetLastIndexOfNumber ( char json, int index ) : int
LookAhead ( char json, int index ) : int
NextToken ( char json, int &index ) : int
ParseArray ( char json, int &index ) : ArrayList
ParseNumber ( char json, int &index ) : float
ParseObject ( char json, int &index ) : Hashtable
ParseString ( char json, int &index ) : string
ParseValue ( char json, int &index, bool &success ) : object
SerializeArray ( ArrayList anArray, StringBuilder builder ) : bool
SerializeNumber ( float number, StringBuilder builder ) : void
SerializeObject ( Hashtable anObject, StringBuilder builder ) : bool
SerializeObjectOrArray ( object objectOrArray, StringBuilder builder ) : bool
SerializeString ( string aString, StringBuilder builder ) : void
SerializeValue ( object value, StringBuilder builder ) : bool

메소드 상세

EatWhitespace() 보호된 메소드

protected EatWhitespace ( char json, int &index ) : void
json char
index int
리턴 void

GetLastErrorIndex() 공개 정적인 메소드

On decoding, this function returns the position at which the parse failed (-1 = no error).
public static GetLastErrorIndex ( ) : int
리턴 int

GetLastErrorSnippet() 공개 정적인 메소드

If a decoding error occurred, this function returns a piece of the JSON string at which the error took place. To ease debugging.
public static GetLastErrorSnippet ( ) : string
리턴 string

GetLastIndexOfNumber() 보호된 메소드

protected GetLastIndexOfNumber ( char json, int index ) : int
json char
index int
리턴 int

JsonDecode() 공개 정적인 메소드

Parses the string json into a value
public static JsonDecode ( string json ) : object
json string A JSON string.
리턴 object

JsonEncode() 공개 정적인 메소드

Converts a Hashtable / ArrayList object into a JSON string
public static JsonEncode ( object json ) : string
json object A Hashtable / ArrayList
리턴 string

LastDecodeSuccessful() 공개 정적인 메소드

On decoding, this function returns the position at which the parse failed (-1 = no error).
public static LastDecodeSuccessful ( ) : bool
리턴 bool

LookAhead() 보호된 메소드

protected LookAhead ( char json, int index ) : int
json char
index int
리턴 int

NextToken() 보호된 메소드

protected NextToken ( char json, int &index ) : int
json char
index int
리턴 int

ParseArray() 보호된 메소드

protected ParseArray ( char json, int &index ) : ArrayList
json char
index int
리턴 ArrayList

ParseNumber() 보호된 메소드

protected ParseNumber ( char json, int &index ) : float
json char
index int
리턴 float

ParseObject() 보호된 메소드

protected ParseObject ( char json, int &index ) : Hashtable
json char
index int
리턴 Hashtable

ParseString() 보호된 메소드

protected ParseString ( char json, int &index ) : string
json char
index int
리턴 string

ParseValue() 보호된 메소드

protected ParseValue ( char json, int &index, bool &success ) : object
json char
index int
success bool
리턴 object

SerializeArray() 보호된 메소드

protected SerializeArray ( ArrayList anArray, StringBuilder builder ) : bool
anArray ArrayList
builder StringBuilder
리턴 bool

SerializeNumber() 보호된 메소드

protected SerializeNumber ( float number, StringBuilder builder ) : void
number float
builder StringBuilder
리턴 void

SerializeObject() 보호된 메소드

protected SerializeObject ( Hashtable anObject, StringBuilder builder ) : bool
anObject Hashtable
builder StringBuilder
리턴 bool

SerializeObjectOrArray() 보호된 메소드

protected SerializeObjectOrArray ( object objectOrArray, StringBuilder builder ) : bool
objectOrArray object
builder StringBuilder
리턴 bool

SerializeString() 보호된 메소드

protected SerializeString ( string aString, StringBuilder builder ) : void
aString string
builder StringBuilder
리턴 void

SerializeValue() 보호된 메소드

protected SerializeValue ( object value, StringBuilder builder ) : bool
value object
builder StringBuilder
리턴 bool

프로퍼티 상세

instance 보호되어 있는 정적으로 프로퍼티

protected static GA_MiniJSON, instance
리턴 GA_MiniJSON,

lastDecode 보호되어 있는 프로퍼티

protected string lastDecode
리턴 string

lastErrorIndex 보호되어 있는 프로퍼티

On decoding, this value holds the position at which the parse failed (-1 = no error).
protected int lastErrorIndex
리턴 int