Definition at line 8 of file JsonUtility.cs.
◆ CombineJsonObjects()
Definition at line 100 of file JsonUtility.cs.
104 foreach (KeyValuePair<string, JsonValue> json
in a)
106 combined.
Add(json.Key, json.Value);
109 foreach (KeyValuePair<string, JsonValue> json
in b)
112 combined.
Add(json.Key, json.Value);
bool ContainsKey(string key)
Determines whether this collection contains an item assosiated with the given key.
Represents a key-value pair collection of JsonValue objects.
JsonObject Add(string key)
Adds a key with a null value to this collection.
◆ ToArray< T >()
static T [] BGC.Utility.JsonUtility.ToArray< T > |
( |
this JsonArray |
jsonArray, |
|
|
Func< JsonValue, T > |
lambda |
|
) |
| |
|
inlinestatic |
Convert json array to array with lambda to convert elements to defined type
- Template Parameters
-
- Parameters
-
- Returns
Definition at line 71 of file JsonUtility.cs.
73 Assert.IsNotNull(lambda);
74 T[] array =
new T[jsonArray.Count];
76 for (
int i = 0; i < array.Length; ++i)
78 array[i] = lambda(jsonArray[i]);
◆ ToIntArray()
static int [] BGC.Utility.JsonUtility.ToIntArray |
( |
this JsonArray |
jsonArray | ) |
|
|
inlinestatic |
Conver json array to array of integers
- Parameters
-
- Returns
Definition at line 89 of file JsonUtility.cs.
References LightJson.JsonArray.Count.
91 int[] array =
new int[jsonArray.Count];
92 for (
int i = 0; i < array.Length; ++i)
94 array[i] = jsonArray[i];
◆ ToJsonArray() [1/2]
static JsonArray BGC.Utility.JsonUtility.ToJsonArray |
( |
this IList< int > |
list | ) |
|
|
inlinestatic |
Convert list of ints to json array
- Parameters
-
- Returns
Definition at line 35 of file JsonUtility.cs.
References LightJson.JsonArray.Add().
38 for (
int i = 0; i < list.Count; ++i)
40 jsonArray.
Add(list[i]);
Represents an ordered collection of JsonValues.
JsonArray Add(JsonValue value)
Adds the given value to this collection.
◆ ToJsonArray() [2/2]
static JsonArray BGC.Utility.JsonUtility.ToJsonArray |
( |
this IList< string > |
list | ) |
|
|
inlinestatic |
Convert list of strings to json array
- Parameters
-
- Returns
Definition at line 51 of file JsonUtility.cs.
References LightJson.JsonArray.Add().
55 int length = list.Count;
56 for (
int i = 0; i < length; ++i)
58 jsonArray.
Add(list[i]);
Represents an ordered collection of JsonValues.
JsonArray Add(JsonValue value)
Adds the given value to this collection.
◆ ToJsonArray< T >()
Convert list to json array with lambda that turns elements into json values
- Template Parameters
-
- Parameters
-
- Returns
Definition at line 17 of file JsonUtility.cs.
References LightJson.JsonArray.Add().
19 Assert.IsNotNull(lambda);
22 for (
int i = 0; i < list.Count; ++i)
24 jsonArray.
Add(lambda(list[i]));
Represents an ordered collection of JsonValues.
JsonArray Add(JsonValue value)
Adds the given value to this collection.
The documentation for this class was generated from the following file: