Online Maps v3
Loading...
Searching...
No Matches
OnlineMapsJSONObject Class Reference

The wrapper for JSON dictonary. More...

Inheritance diagram for OnlineMapsJSONObject:
OnlineMapsJSONItem

Public Member Functions

 OnlineMapsJSONObject ()
 Constructor.
 
void Add (string name, OnlineMapsJSONItem value)
 Adds element to the dictionary.
 
override OnlineMapsJSONItem AppendObject (object obj)
 Serializes the object and adds to the current json node.
 
void Combine (OnlineMapsJSONItem other, bool overwriteExistingValues=false)
 Combines two JSON Object.
 
object Deserialize (Type type, IEnumerable< MemberInfo > members)
 Deserializes current element.
 
- Public Member Functions inherited from OnlineMapsJSONItem
ChildValue< T > (string childName)
 Returns the value of the child element, converted to the specified type.
 
Deserialize< T > ()
 Deserializes current element.
 
object Deserialize (Type type)
 Deserializes current element.
 
OnlineMapsJSONItem GetAll (string key)
 Get all elements with the key on the first or the deeper levels of the current element.
 
void ToJSON (StringBuilder b)
 Converts the current and the child elements to JSON string.
 
object Value (Type type)
 Returns the value of the element, converted to the specified type.
 
virtual T Value< T > ()
 Returns the value of the element, converted to the specified type.
 
V< T > ()
 Returns the value of the element, converted to the specified type.
 
V< T > (string childName)
 Returns the value of the child element, converted to the specified type.
 

Static Public Member Functions

static OnlineMapsJSONObject ParseObject (string json)
 Parse a string that contains JSON dictonary.
 

Properties

Dictionary< string, OnlineMapsJSONItemtable [get]
 Dictionary of items.
 
- Properties inherited from OnlineMapsJSONItem
OnlineMapsJSONItem this[int index] [get]
 Get the element by index.
 
OnlineMapsJSONItem this[string key] [get]
 Get the element by key.
Supports XPath like selectors:
["key"] - get element by key.
["key1/key2"] - get element key2, which is a child of the element key1.
["key/N"] - where N is number. Get array element by index N, which is a child of the element key1.
["key/*"] - get all array elements, which is a child of the element key1.
["//key"] - get all elements with the key on the first or the deeper levels of the current element.

 

Detailed Description

The wrapper for JSON dictonary.

Member Function Documentation

◆ Add()

void OnlineMapsJSONObject.Add ( string name,
OnlineMapsJSONItem value )

Adds element to the dictionary.

Parameters
nameKey
valueValue

◆ AppendObject()

override OnlineMapsJSONItem OnlineMapsJSONObject.AppendObject ( object obj)
virtual

Serializes the object and adds to the current json node.

Parameters
objObject
Returns
Current json node

Reimplemented from OnlineMapsJSONItem.

◆ Combine()

void OnlineMapsJSONObject.Combine ( OnlineMapsJSONItem other,
bool overwriteExistingValues = false )

Combines two JSON Object.

Parameters
otherOther JSON Object
overwriteExistingValuesOverwrite the existing values?

◆ Deserialize()

object OnlineMapsJSONObject.Deserialize ( Type type,
IEnumerable< MemberInfo > members )

Deserializes current element.

Parameters
typeType
membersMembers of variable
Returns
Object

◆ ParseObject()

static OnlineMapsJSONObject OnlineMapsJSONObject.ParseObject ( string json)
static

Parse a string that contains JSON dictonary.

Parameters
jsonString that contains JSON dictonary
Returns
Instance