DocFX + Singulink = ♥

Struct JsonObject

A JSON object.

Implements
IEnumerable<KeyValuePair<string, JsonAny>>
IEnumerable
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
Namespace: SlugBase
Assembly: SlugBase.dll
Syntax
public readonly struct JsonObject : IEnumerable<KeyValuePair<string, JsonAny>>, IEnumerable

Properties

View Source

this[string]

Get an element from this object.

Declaration
public JsonAny this[string key] { get; }
Parameters
Type Name Description
string key

The JSON property to search for.

Property Value
Type Description
JsonAny

The found value.

Exceptions
Type Condition
JsonException

The specified property doesn't exist.

Methods

View Source

Get(string)

Get an element from this object.

Declaration
public JsonAny Get(string key)
Parameters
Type Name Description
string key

The JSON property to search for.

Returns
Type Description
JsonAny

The found value.

Exceptions
Type Condition
JsonException

The specified property doesn't exist.

View Source

GetBool(string)

Get a bool from this object.

Declaration
public bool GetBool(string key)
Parameters
Type Name Description
string key

The JSON property to search for.

Returns
Type Description
bool
Exceptions
Type Condition
JsonException

The specified property doesn't exist or was the wrong type.

View Source

GetDouble(string)

Get a double from this object.

Declaration
public double GetDouble(string key)
Parameters
Type Name Description
string key

The JSON property to search for.

Returns
Type Description
double
Exceptions
Type Condition
JsonException

The specified property doesn't exist or was the wrong type.

View Source

GetEnumerator()

Get an enumerator for all properties and values of this object.

Declaration
public IEnumerator<KeyValuePair<string, JsonAny>> GetEnumerator()
Returns
Type Description
IEnumerator<KeyValuePair<string, JsonAny>>
View Source

GetFloat(string)

Get a float from this object.

Declaration
public float GetFloat(string key)
Parameters
Type Name Description
string key

The JSON property to search for.

Returns
Type Description
float
Exceptions
Type Condition
JsonException

The specified property doesn't exist or was the wrong type.

View Source

GetInt(string)

Get an int from this object.

Declaration
public int GetInt(string key)
Parameters
Type Name Description
string key

The JSON property to search for.

Returns
Type Description
int
Exceptions
Type Condition
JsonException

The specified property doesn't exist or was the wrong type.

View Source

GetList(string)

Get a JsonList from this object.

Declaration
public JsonList GetList(string key)
Parameters
Type Name Description
string key

The JSON property to search for.

Returns
Type Description
JsonList
Exceptions
Type Condition
JsonException

The specified property doesn't exist or was the wrong type.

View Source

GetLong(string)

Get a long from this object.

Declaration
public long GetLong(string key)
Parameters
Type Name Description
string key

The JSON property to search for.

Returns
Type Description
long
Exceptions
Type Condition
JsonException

The specified property doesn't exist or was the wrong type.

View Source

GetObject(string)

Get a JsonObject from this object.

Declaration
public JsonObject GetObject(string key)
Parameters
Type Name Description
string key

The JSON property to search for.

Returns
Type Description
JsonObject
Exceptions
Type Condition
JsonException

The specified property doesn't exist.

View Source

GetString(string)

Get a string from this object.

Declaration
public string GetString(string key)
Parameters
Type Name Description
string key

The JSON property to search for.

Returns
Type Description
string
Exceptions
Type Condition
JsonException

The specified property doesn't exist or was the wrong type.

View Source

TryGet(string)

Get an element from this object.

Declaration
public JsonAny? TryGet(string key)
Parameters
Type Name Description
string key

The JSON property to search for.

Returns
Type Description
JsonAny?

The found value, or null if the property doesn't exist.

Operators

View Source

implicit operator JsonAny(JsonObject)

Get obj as a JsonAny.

Declaration
public static implicit operator JsonAny(JsonObject obj)
Parameters
Type Name Description
JsonObject obj
Returns
Type Description
JsonAny

Implements

IEnumerable<T>
IEnumerable