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