Class InputJSONNodeReader
Parses JSON text into a InputJSONNode tree, preserving member order and numeric source text so the document can later be written back unchanged.
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public static class InputJSONNodeReader
Remarks
Built on the Core Scylla.Core.Util.Serialization.ScyllaJSONReader, which is a forward-only pull parser. Because this builds a complete tree rather than mapping onto a fixed schema, members that no code understands are retained by the same path as ones that are, and nothing needs to be skipped.
Nesting is capped by MAX_DEPTH. The underlying reader has no depth guard of its own, and a deeply nested or adversarial document would otherwise overflow the stack rather than produce an error.
Fields
MAX_DEPTH
Maximum nesting depth accepted. A Unity input action asset nests five levels, so this leaves ample headroom while still bounding recursion.
Declaration
public const int MAX_DEPTH = 128
Field Value
| Type | Description |
|---|---|
| int |
Methods
Parse(string)
Parses JSON text into a node tree.
Declaration
public static InputJSONNode Parse(string json)
Parameters
| Type | Name | Description |
|---|---|---|
| string | json | The document text. |
Returns
| Type | Description |
|---|---|
| InputJSONNode | The root node. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the text is null or empty. |
| SerializationException | Thrown when the text is not well-formed JSON or exceeds MAX_DEPTH. |
TryParse(string, out InputJSONNode, out string)
Attempts to parse JSON text into a node tree, reporting failure rather than throwing.
Declaration
public static bool TryParse(string json, out InputJSONNode root, out string error)
Parameters
| Type | Name | Description |
|---|---|---|
| string | json | The document text. |
| InputJSONNode | root | The root node on success, otherwise |
| string | error | A description of the failure on failure, otherwise |
Returns
| Type | Description |
|---|---|
| bool |
|