JSONObject (open)
JSON object wrapper, contains a (key, value) store with case-sensitive keys
Syntax
// Core function, no LOADLIB necessary
OBJECTTYPE JSONObject
Constructor
- MACRO NEW(VARIANT initval)
Constructs a new JSON object, converts the records and arrays in the value to JSONObject and JSONArray
Functions
- MACRO Assign(VARIANT newrec)
Assign the contents of a record/object to this object
- OBJECT FUNCTION DeepClone()
Returns a deep clone of this object
- MACRO DeleteProp(STRING name)
Removes a property
- STRING ARRAY FUNCTION GetKeys()
Returns the list of all set properties
- VARIANT FUNCTION GetProp(STRING name, RECORD options)
Get the value of a property
- RECORD FUNCTION GetValue()
Returns the value in this object as HareScript value (converting all contained JSONObject and JSONArray objects to their HareScript value too)
- BOOLEAN FUNCTION HasProp(STRING name)
Returns whether a property with this name is present in this object
- VARIANT FUNCTION SetProp(STRING name, VARIANT value)
Set the value of a property
- MACRO SetValue(VARIANT val)
Overwrites the contents of this object
- RECORD ARRAY FUNCTION Unpack()
Returns the list of property names and values