Struct JsonList
A JSON list.
Inherited Members
Namespace: SlugBase
Assembly: SlugBase.dll
Syntax
public readonly struct JsonList : IReadOnlyList<JsonAny>, IReadOnlyCollection<JsonAny>, IEnumerable<JsonAny>, IEnumerable
Properties
View SourceCount
Get the number of elements in this list.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
this[int]
Get an element from this list.
Declaration
public JsonAny this[int key] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Property Value
Type | Description |
---|---|
JsonAny | The found value. |
Exceptions
Type | Condition |
---|---|
JsonException |
|
Methods
View SourceGet(int)
Get an element from this list.
Declaration
public JsonAny Get(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Returns
Type | Description |
---|---|
JsonAny | The found value. |
Exceptions
Type | Condition |
---|---|
JsonException |
|
GetBool(int)
Get a bool from this list.
Declaration
public bool GetBool(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Returns
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
JsonException |
|
GetDouble(int)
Get a double from this list.
Declaration
public double GetDouble(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Returns
Type | Description |
---|---|
double |
Exceptions
Type | Condition |
---|---|
JsonException |
|
GetEnumerator()
Gets an enumerator for all elements of this list.
Declaration
public IEnumerator<JsonAny> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<JsonAny> |
GetFloat(int)
Get a float from this list.
Declaration
public float GetFloat(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Returns
Type | Description |
---|---|
float |
Exceptions
Type | Condition |
---|---|
JsonException |
|
GetInt(int)
Get an int from this list.
Declaration
public int GetInt(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Returns
Type | Description |
---|---|
int |
Exceptions
Type | Condition |
---|---|
JsonException |
|
GetList(int)
Get a JsonList from this list.
Declaration
public JsonList GetList(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Returns
Type | Description |
---|---|
JsonList |
Exceptions
Type | Condition |
---|---|
JsonException |
|
GetLong(int)
Get a long from this list.
Declaration
public long GetLong(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Returns
Type | Description |
---|---|
long |
Exceptions
Type | Condition |
---|---|
JsonException |
|
GetObject(int)
Get a JsonObject from this list.
Declaration
public JsonObject GetObject(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Returns
Type | Description |
---|---|
JsonObject |
Exceptions
Type | Condition |
---|---|
JsonException |
|
GetString(int)
Get a string from this list.
Declaration
public string GetString(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Returns
Type | Description |
---|---|
string |
Exceptions
Type | Condition |
---|---|
JsonException |
|
TryGet(int)
Get an element from this list.
Declaration
public JsonAny? TryGet(int key)
Parameters
Type | Name | Description |
---|---|---|
int | key | The index. |
Returns
Type | Description |
---|---|
JsonAny? | The found value, or |
Operators
View Sourceimplicit operator JsonAny(JsonList)
Get list
as a JsonAny.
Declaration
public static implicit operator JsonAny(JsonList list)
Parameters
Type | Name | Description |
---|---|---|
JsonList | list |
Returns
Type | Description |
---|---|
JsonAny |