C# 클래스 FistBump.Framework.MiniJSON

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 doubles.
파일 보기 프로젝트 열기: fistbump/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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 / Dictionary(string,string) 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 ) : double
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
serializeDictionary ( string>.Dictionary dict, StringBuilder builder ) : bool
serializeNumber ( double 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 static 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 static 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 / Dictionary(string,string) 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 static lookAhead ( char json, int index ) : int
json char
index int
리턴 int

nextToken() 보호된 정적인 메소드

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

parseArray() 보호된 정적인 메소드

protected static parseArray ( char json, int &index ) : ArrayList
json char
index int
리턴 System.Collections.ArrayList

parseNumber() 보호된 정적인 메소드

protected static parseNumber ( char json, int &index ) : double
json char
index int
리턴 double

parseObject() 보호된 정적인 메소드

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

parseString() 보호된 정적인 메소드

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

parseValue() 보호된 정적인 메소드

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

serializeArray() 보호된 정적인 메소드

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

serializeDictionary() 보호된 정적인 메소드

protected static serializeDictionary ( string>.Dictionary dict, StringBuilder builder ) : bool
dict string>.Dictionary
builder StringBuilder
리턴 bool

serializeNumber() 보호된 정적인 메소드

protected static serializeNumber ( double number, StringBuilder builder ) : void
number double
builder StringBuilder
리턴 void

serializeObject() 보호된 정적인 메소드

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

serializeObjectOrArray() 보호된 정적인 메소드

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

serializeString() 보호된 정적인 메소드

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

serializeValue() 보호된 정적인 메소드

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

프로퍼티 상세

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

protected static string lastDecode
리턴 string

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

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