All Bundles
JsonBuilder
Stack driven JSON builder
Operations
Code example:
builder := JsonBuilder->New();
money := builder->PushObject();
money->Insert("type", "usd");
money->Insert("amount", "1013");
deposits := JsonElement->New(JsonElement->JsonType->ARRAY);
deposits->Add(115);
deposits->Add(318);
deposits->Add(580);
money->Insert("deposits", deposits);
builder->Pop()->ToString()->PrintLine();
New
Constructor
New()
Add
Adds a value
method : public : Add(value:String) ~ JsonBuilder
Parameters
Name | Type | Description |
---|
value | String | value |
Return
Type | Description |
---|
JsonBuilder | true if successful, false otherwise |
Adds a value
method : public : Add(value:Int) ~ JsonBuilder
Parameters
Name | Type | Description |
---|
value | Int | value |
Return
Type | Description |
---|
JsonBuilder | true if successful, false otherwise |
Adds a value
method : public : Add(value:Float) ~ JsonBuilder
Parameters
Name | Type | Description |
---|
value | Float | value |
Return
Type | Description |
---|
JsonBuilder | true if successful, false otherwise |
Adds a value
method : public : Add(value:Bool) ~ JsonBuilder
Parameters
Name | Type | Description |
---|
value | Bool | value |
Return
Type | Description |
---|
JsonBuilder | true if successful, false otherwise |
Adds a value
method : public : Add(value:JsonElement) ~ JsonBuilder
Parameters
Return
Type | Description |
---|
JsonBuilder | true if successful, false otherwise |
Insert
Insert an element
method : public : Insert(name:String, value:Int) ~ JsonBuilder
Parameters
Name | Type | Description |
---|
name | String | element name |
value | Int | value |
Return
Type | Description |
---|
JsonBuilder | true if successful, false otherwise |
Insert an element
method : public : Insert(name:String, value:Float) ~ JsonBuilder
Parameters
Name | Type | Description |
---|
name | String | element name |
value | Float | value |
Return
Type | Description |
---|
JsonBuilder | true if successful, false otherwise |
Insert an element
method : public : Insert(name:String, value:String) ~ JsonBuilder
Parameters
Return
Type | Description |
---|
JsonBuilder | true if successful, false otherwise |
Insert an element
method : public : Insert(name:String, value:Bool) ~ JsonBuilder
Parameters
Name | Type | Description |
---|
name | String | element name |
value | Bool | value |
Return
Type | Description |
---|
JsonBuilder | true if successful, false otherwise |
Insert an element
method : public : Insert(name:String, value:JsonElement) ~ JsonBuilder
Parameters
Return
Type | Description |
---|
JsonBuilder | true if successful, false otherwise |
Pop
Pops a value
method : public : Pop() ~ JsonElement
Return
PopAll
Pop all values
method : public : PopAll() ~ JsonElement
Return
PushArray
Pushes an array element on the stack
method : public : PushArray() ~ JsonBuilder
PushObject
Pushes an object element on the stack
method : public : PushObject() ~ JsonBuilder
Pushes an object element on the stack
method : public : PushObject(name:String) ~ JsonBuilder
Parameters
Name | Type | Description |
---|
name | String | object name |
Size
Size of element stack
method : public : Size() ~ Int