Table of Contents

Class JsonExpr

Namespace
Invex.StructuredText.Expressions
Assembly
Invex.StructuredText.dll

An expression whose value is an object, an array, or of a type not known statically.

public abstract record JsonExpr : Expr
Inheritance
object
JsonExpr
Derived
Inherited Members

Remarks

Navigate with the indexers and convert with AsString(), AsBool() or AsNumber() when the value's type is known.

Constructors

JsonExpr()

protected JsonExpr()

Properties

this[int]

Accesses an element of this array.

public JsonExpr this[int index] { get; }

Parameters

index int

The zero-based index.

Property Value

JsonExpr

this[string]

Accesses a property of this object. The name is a single key: it may contain dots or spaces, and the printer uses ['name'] syntax where .name isn't valid.

public JsonExpr this[string property] { get; }

Parameters

property string

The property name.

Property Value

JsonExpr

Methods

AsBool()

Treats this value as a boolean.

public BoolExpr AsBool()

Returns

BoolExpr

AsNumber()

Treats this value as a number.

public NumberExpr AsNumber()

Returns

NumberExpr

AsString()

Treats this value as a string.

public StringExpr AsString()

Returns

StringExpr

Contains(Expr)

Tests whether this array contains the element value. To search text, convert with AsString() and use Contains(StringExpr).

public BoolExpr Contains(Expr value)

Parameters

value Expr

The element to search for.

Returns

BoolExpr

Join(StringExpr?)

Joins the elements of this array with separator.

public StringExpr Join(StringExpr? separator = null)

Parameters

separator StringExpr

The separator; the platform default when null.

Returns

StringExpr

ToJson()

Serializes this value to JSON text.

public StringExpr ToJson()

Returns

StringExpr