class · System.Text

JsonValue

public class System.Text.JsonValue : System.Any
Kind
class
Namespace
System.Text
Assembly
System.Core
Access
public, final
Source file
Json.ant

Inheritance

Base classes
Any JsonValue

Constructors

constructor JsonValue(kind: System.Text.JsonKind)
#

Properties

property Kind: System.Text.JsonKind
#

read-only

property IsNull: bool
#

read-only

property AsBool: bool
#

read-only

property AsNumber: f64
#

read-only

property AsString: System.String<u8>
#

read-only

property Count: i32
#

read-only

Items of an array, or members of an obj.

Methods

static method Null() -> System.Text.JsonValue
#

static

static method Of(value: bool) -> System.Text.JsonValue
#

static

static method Of(value: f64) -> System.Text.JsonValue
#

static

static method Of(value: i32) -> System.Text.JsonValue
#

static

static method Of(value: System.String<u8>) -> System.Text.JsonValue
#

static

static method NewArray() -> System.Text.JsonValue
#

static

static method NewObject() -> System.Text.JsonValue
#

static

method At(index: i32) -> System.Text.JsonValue
#

An array's item.

Appends to an array (returns this, to chain).

method KeyAt(index: i32) -> System.String<u8>
#

The key of the i-th member of an obj.

method ValueAt(index: i32) -> System.Text.JsonValue
#

The i-th member's value.

method Has(key: System.String<u8>) -> bool
#
method Get(key: System.String<u8>) -> System.Text.JsonValue?
#

An obj's member, or null when there is none.

Sets an obj's member (replacing one with that key; returns this, to chain).

method ToString() -> System.String<u8>
#

override

The value as JSON text (compact).

static method Parse(json: System.String<u8>) -> System.Text.JsonValue
#

static

Private and internal members (15)

static constant IndexFrom: i32
#

private

Objects up to this many members find a key by looking at each one; bigger ones keep an index.

field kind: System.Text.JsonKind
#

private

field boolean: bool
#

private

field number: f64
#

private

field text: System.String<u8>
#

private

private

field keys: System.List<System.String<u8>>?
#

private

private

method Expect(wanted: System.Text.JsonKind, what: System.String<u8>) -> void
#

private

method Items() -> System.List<System.Text.JsonValue>
#

private

method Keys() -> System.List<System.String<u8>>
#

private

method Find(key: System.String<u8>) -> i32
#

private

Where an object's member key is, or -1.

static method WriteText(sb: System.StringBuilder, value: System.String<u8>) -> void
#

private static

value in quotes, escaped: the units that need no escape go in as runs.

static method Hex(digit: u32) -> u16
#

private static

method Write(sb: System.StringBuilder) -> void
#

private

Inherited members (4)

Source

JsonValue as Larva HIR, decompiled from its Larva HIR.

System.Text.JsonValue.hir
public class System.Text.JsonValue : System.Any
{
    // Objects up to this many members find a key by looking at each one; bigger ones keep an index.
    static constant IndexFrom: i32
    field kind: System.Text.JsonKind
    field boolean: bool
    field number: f64
    field text: System.String<u8>
    field items: System.List<System.Text.JsonValue>?
    field keys: System.List<System.String<u8>>?
    field index: System.Dictionary<System.String<u8>, i32>?
    constructor JsonValue(kind: System.Text.JsonKind)
    method Expect(wanted: System.Text.JsonKind, what: System.String<u8>) -> void
    method Items() -> System.List<System.Text.JsonValue>
    method Keys() -> System.List<System.String<u8>>
    // Where an object's member `key` is, or -1.
    method Find(key: System.String<u8>) -> i32
    // `value` in quotes, escaped: the units that need no escape go in as runs.
    static method WriteText(sb: System.StringBuilder, value: System.String<u8>) -> void
    static method Hex(digit: u32) -> u16
    method Write(sb: System.StringBuilder) -> void
    static method Null() -> System.Text.JsonValue
    static method Of(value: bool) -> System.Text.JsonValue
    static method Of(value: f64) -> System.Text.JsonValue
    static method Of(value: i32) -> System.Text.JsonValue
    static method Of(value: System.String<u8>) -> System.Text.JsonValue
    static method NewArray() -> System.Text.JsonValue
    static method NewObject() -> System.Text.JsonValue
    // An array's item.
    method At(index: i32) -> System.Text.JsonValue
    // Appends to an array (returns this, to chain).
    method Add(item: System.Text.JsonValue) -> System.Text.JsonValue
    // The key of the i-th member of an obj.
    method KeyAt(index: i32) -> System.String<u8>
    // The i-th member's value.
    method ValueAt(index: i32) -> System.Text.JsonValue
    method Has(key: System.String<u8>) -> bool
    // An obj's member, or null when there is none.
    method Get(key: System.String<u8>) -> System.Text.JsonValue?
    // Sets an obj's member (replacing one with that key; returns this, to chain).
    method Set(key: System.String<u8>, value: System.Text.JsonValue) -> System.Text.JsonValue
    // The value as JSON text (compact).
    method ToString() -> System.String<u8>
    static method Parse(json: System.String<u8>) -> System.Text.JsonValue
    property Kind: System.Text.JsonKind
    property IsNull: bool
    property AsBool: bool
    property AsNumber: f64
    property AsString: System.String<u8>
    // Items of an array, or members of an obj.
    property Count: i32
}
Esc