Difference between revisions of "ObjectType:jsonobject"

From Lavish Software Wiki
Jump to navigation Jump to search
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
{{ObjectType-Vitals|jsonobject|[[LavishScript]]|[[ObjectType:jsonvalue]]|same as ToString|jsonvaluecontainer|no|void *}}
+
{{ObjectType-Vitals|jsonobject|[[LavishScript]]|[[ObjectType:jsonvalue]]|same as jsonvalue.AsString|none|no|void *}}
  
 
A '''jsonobject''' is a standard [https://www.json.org/ JSON] object.
 
A '''jsonobject''' is a standard [https://www.json.org/ JSON] object.
Line 7: Line 7:
 
* ... '''Get['''valueName''']''': Gets a value stored within this object, by its name
 
* ... '''Get['''valueName''']''': Gets a value stored within this object, by its name
 
* ... '''Get['''valueName''','''valueName2''',...]''': Gets a stored value multiple levels deep within jsonobjects and/or jsonarrays
 
* ... '''Get['''valueName''','''valueName2''',...]''': Gets a stored value multiple levels deep within jsonobjects and/or jsonarrays
 +
* bool '''Has['''valueName''']''': Checks whether a value is stored within this object, by its name
 +
* bool '''Has['''valueName''','''valueName2''',...]''': Checks whether a value is stored, multiple levels deep within jsonobjects and/or jsonarrays
 +
* bool '''Assert['''valueName''','''json''']''': Checks whether a value is stored within this object AND matches the specified JSON value
 +
* bool '''Assert['''valueName''','''valueName2''',...,'''json''']''': Checks whether a value is stored, multiple levels deep within jsonobjects and/or jsonarrays, AND matches the specified JSON value
  
 
== Methods ==
 
== Methods ==
Line 12: Line 16:
 
*'''Set['''valueName''','''json''']''': Sets a value within the object, to a new JSON value of any type, e.g. <tt>myJsonObject:Set["someObject","{\"subValue\":12}"]</tt>
 
*'''Set['''valueName''','''json''']''': Sets a value within the object, to a new JSON value of any type, e.g. <tt>myJsonObject:Set["someObject","{\"subValue\":12}"]</tt>
 
*'''GetIterator['''jsoniterator''']''': Sets a jsoniterator to iterate this JSON object
 
*'''GetIterator['''jsoniterator''']''': Sets a jsoniterator to iterate this JSON object
 +
*'''Erase['''valueName''']''': Erases the specified value from the object
 +
*'''EraseByQuery['''Query ID''']''': Erases items matching the query from the object
 +
*'''EraseByQuery['''Query ID''','''bool removeMatches''']''': Erases items either matching or not matching the query from the object (depending on the 2nd parameter)
  
 
== See Also ==
 
== See Also ==
* [[LavishScript]]
+
{{LavishScript:ObjectType}}
 
 
[[Category:LavishScript]]
 
 
[[Category:JSON]]
 
[[Category:JSON]]

Revision as of 14:08, 7 August 2019

Overview

Object Type Vitals
jsonobject
Defined By LavishScript
Inherits ObjectType:jsonvalue
Reduces To same as jsonvalue.AsString
Variable Object Type none
Uses Sub-Types no
C/C++ Type void *

A jsonobject is a standard JSON object.

Members

  • ... Get[valueName]: Gets a value stored within this object, by its name
  • ... Get[valueName,valueName2,...]: Gets a stored value multiple levels deep within jsonobjects and/or jsonarrays
  • bool Has[valueName]: Checks whether a value is stored within this object, by its name
  • bool Has[valueName,valueName2,...]: Checks whether a value is stored, multiple levels deep within jsonobjects and/or jsonarrays
  • bool Assert[valueName,json]: Checks whether a value is stored within this object AND matches the specified JSON value
  • bool Assert[valueName,valueName2,...,json]: Checks whether a value is stored, multiple levels deep within jsonobjects and/or jsonarrays, AND matches the specified JSON value

Methods

  • Clear: Clears all values from the object
  • Set[valueName,json]: Sets a value within the object, to a new JSON value of any type, e.g. myJsonObject:Set["someObject","{\"subValue\":12}"]
  • GetIterator[jsoniterator]: Sets a jsoniterator to iterate this JSON object
  • Erase[valueName]: Erases the specified value from the object
  • EraseByQuery[Query ID]: Erases items matching the query from the object
  • EraseByQuery[Query ID,bool removeMatches]: Erases items either matching or not matching the query from the object (depending on the 2nd parameter)

See Also

LavishScript Object Types