CloudOnce v2.7.5
Unified Game Services API
CloudOnce.Internal.JSONObject Class Reference

Public Types

enum  Type {
  Null , String , Number , Object ,
  Array , Bool , Baked
}
 

Public Member Functions

 JSONObject (Type t)
 
 JSONObject (bool b)
 
 JSONObject (float f)
 
 JSONObject (Dictionary< string, string > dic)
 
 JSONObject (Dictionary< string, JSONObject > dic)
 
 JSONObject (AddJsonContents content)
 
 JSONObject (IEnumerable< JSONObject > objects)
 
 JSONObject (string str, int maxDepth=-2, bool storeExcessLevels=false, bool strict=false)
 
delegate void AddJsonContents (JSONObject self)
 
void Absorb (JSONObject obj)
 
void Add (JSONObject obj)
 
void AddField (string name, bool val)
 
void AddField (string name, float val)
 
void AddField (string name, string val)
 
void AddField (string name, JSONObject obj)
 
void RemoveField (string name)
 
bool HasFields (params string[] names)
 
override string ToString ()
 
string ToString (bool pretty)
 
Dictionary< string, string > ToDictionary ()
 

Static Public Member Functions

static implicit operator bool (JSONObject o)
 
static JSONObject StringObject (string val)
 
static JSONObject Create ()
 
static JSONObject Create (Type t)
 
static JSONObject Create (bool val)
 
static JSONObject Create (float val)
 
static JSONObject Create (int val)
 
static JSONObject CreateStringObject (string val)
 
static JSONObject CreateBakedObject (string val)
 
static JSONObject Create (string val, int maxDepth=-2, bool storeExcessLevels=false, bool strict=false)
 Create a JSONObject by parsing string data More...
 
static JSONObject Create (AddJsonContents content)
 
static JSONObject Create (Dictionary< string, string > dic)
 
static JSONObject Create (Dictionary< string, float > dic)
 

Properties

List< JSONObjectList [get]
 
bool IsContainer [get]
 
Type ObjectType [get, set]
 
List< string > Keys [get]
 
string String [get]
 
float F [get]
 
bool B [get]
 
JSONObject this[int index] [get, set]
 
JSONObject this[string index] [get, set]
 

Member Function Documentation

◆ Create()

static JSONObject CloudOnce.Internal.JSONObject.Create ( string  val,
int  maxDepth = -2,
bool  storeExcessLevels = false,
bool  strict = false 
)
inlinestatic

Create a JSONObject by parsing string data

Parameters
valThe string to be parsed
maxDepthThe maximum depth for the parser to search. Set this to to 1 for the first level, 2 for the first 2 levels, etc. It defaults to -2 because -1 is the depth value that is parsed (see below)
storeExcessLevelsWhether to store levels beyond maxDepth in baked JSONObjects
strictWhether to be strict in the parsing. For example, non-strict parsing will successfully parse "a string" into a string-type
Returns
The created JSON object.

The documentation for this class was generated from the following file: