Class brl.json.JsonObject - leonard-thieu/monkey GitHub Wiki

Extends

  • JsonValue

Constructors

Methods

Constructor Documentation

Method New ()

Creates a new empty json object.

Method New ( json:String )

Creates a new json object from the given JSON string.

Throws a JsonError if json is invalid.

Method New ( data:StringMap )

Creates a new json object with the given data.

Method Documentation

Method Contains : Bool ( key:String )

Returns true if the json object contains key.

Method Get : JsonValue ( key:String, defval:JsonValue )

Returns defval if key doesn't exist.

Returns a JsonNull object if key is mapped to null.

Method GetBool : Int ( key:String, defval:Bool )

Returns defval if key doesn't exist.

Throws a JsonError if value mapped to key is not a JsonBool.

Method GetData : StringMap ()

Gets the internal map used to represent the object.

Method GetFloat : Float ( key:String, defval:Float )

Returns defval if key doesn't exist.

Throws a JsonError if value mapped to key is not a JsonNumber.

Method GetInt : Int ( key:String, defval:Int )

Returns defval if key doesn't exist.

Throws a JsonError if value mapped to key is not a JsonNumber.

Method GetString : String ( key:String, defval:String )

Returns defval if key doesn't exist.

Throws a JsonError if value mapped to key is not a JsonString.

Method PushJson : Void ( buf:StringStack )

Method Set : Void ( key:String, value:JsonValue )

Method SetBool : Void ( key:String, value:Bool )

Method SetFloat : Void ( key:String, value:Float )

Method SetInt : Void ( key:String, value:Int )

Method SetString : Void ( key:String, value:String )

⚠️ **GitHub.com Fallback** ⚠️