Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Echo/llms.txt
Use this file to discover all available pages before exploring further.
EchoObject is the universal intermediate representation that sits between your .NET objects and any serialized format. Every serialized value — whether a primitive integer, a nested compound object, or a heterogeneous list — is expressed as an EchoObject tagged with an EchoType discriminant. Because EchoObject is format-agnostic, a single in-memory tree can be written to binary, text, JSON, BSON, YAML, or XML without re-serializing the original .NET objects.
EchoType Enum
EchoType identifies what kind of data an EchoObject holds. Every instance has exactly one TagType.
| Value | Description |
|---|---|
Null | Represents the absence of a value. |
Byte | Unsigned 8-bit integer (byte). |
sByte | Signed 8-bit integer (sbyte). |
Short | Signed 16-bit integer (short). |
Int | Signed 32-bit integer (int). |
Long | Signed 64-bit integer (long). |
UShort | Unsigned 16-bit integer (ushort). |
UInt | Unsigned 32-bit integer (uint). |
ULong | Unsigned 64-bit integer (ulong). |
Float | Single-precision floating point (float). |
Double | Double-precision floating point (double). |
Decimal | Decimal (decimal). |
String | UTF-16 string (string). |
ByteArray | Raw byte array (byte[]). |
Bool | Boolean (bool). |
List | Ordered list of EchoObject children. |
Compound | Named dictionary of EchoObject children (key → value). |
Constructors
Each primitive constructor setsTagType to the matching EchoType and stores the value internally.
Static factories
Prefer these helpers over calling theEchoType-overload constructor directly — they set up the internal dictionary/list and parent-tracking in one step.
Properties
The discriminant that identifies what kind of data this object holds. Read-only after construction (except when a delta operation mutates a node in-place).
The raw boxed value. Getting returns the internal
_value field directly. Setting calls SetValue(value), which validates the new value against the current TagType and performs numeric conversions where possible.The parent
EchoObject, or null for a root node. Set automatically when the object is added to a compound or list.The key under which this object is stored in its parent compound.
null when the parent is a list or when there is no parent.The zero-based index at which this object sits in its parent list.
null when the parent is a compound or when there is no parent.The number of direct children. Returns the dictionary size for
Compound, the list length for List, and 0 for all primitive types including Null.true for every EchoType except Compound, List, and Null — i.e., all types that carry a single scalar value.Direct accessor for the underlying dictionary of named children. Only valid when
TagType == EchoType.Compound; returns null (via cast) for any other type. Prefer the compound indexer or Get/TryGet for safe access.Direct accessor for the underlying ordered list of children. Only valid when
TagType == EchoType.List; returns null (via cast) for any other type. Prefer Get(int) or ListAdd/ListRemoveAt for safe access.Value Accessors
Each typed accessor provides a strongly-typed getter and setter. Numeric accessors useConvert and therefore perform widening/narrowing coercions; non-matching types throw InvalidCastException.
| Property | Type | Notes |
|---|---|---|
BoolValue | bool | Direct cast; throws on non-Bool types. |
ByteValue | byte | Convert.ToByte. |
sByteValue | sbyte | Convert.ToSByte. |
ShortValue | short | Convert.ToInt16. |
IntValue | int | Convert.ToInt32. |
LongValue | long | Convert.ToInt64. |
UShortValue | ushort | Convert.ToUInt16. |
UIntValue | uint | Convert.ToUInt32. |
ULongValue | ulong | Convert.ToUInt64. |
FloatValue | float | Convert.ToSingle. |
DoubleValue | double | Convert.ToDouble. |
DecimalValue | decimal | Convert.ToDecimal. |
ByteArrayValue | byte[] | Direct cast; throws on non-ByteArray types. |
StringValue | string | Numeric types use InvariantCulture. Null → "NULL". ByteArray → Base64. Throws on Compound/List. |
Compound Methods
Compound methods operate onEchoObject instances whose TagType is EchoType.Compound. Most throw InvalidOperationException when called on a non-compound node.
Indexer — this[string tagName]
ArgumentException if the new value already has a parent (clone it first).
Get(string)
null if it does not exist.
The key to look up. Must not be null or empty.
TryGet(string, out EchoObject?)
true and populates result if the key exists; returns false and sets result to null otherwise.
Contains(string)
true if a child with tagName exists in this compound.
Add(string, EchoObject)
ArgumentException if:
nameis null or empty.newTagis null or references this node.newTagalready has a parent (clone it withClone()first).- A child with the same name already exists (use the indexer to overwrite).
The key to store the child under.
The child to add.
Remove(string)
true. Returns false if the key does not exist.
Rename(string, string)
ArgumentException if oldName does not exist or newName is already taken.
The current key of the child.
The desired new key.
GetNames()
GetAllTags()
GetStoredType()
$type key is present), resolves and returns the stored Type. Returns null if no type metadata was written.
List Methods
List methods operate onEchoObject instances whose TagType is EchoType.List. All mutating methods keep ListIndex values consistent across the entire list.
Indexer — this[int tagIdx]
Get(int)
tagIdx. Throws InvalidOperationException on non-list nodes.
ListAdd(EchoObject)
tag to the end of the list and sets its Parent and ListIndex. Throws if tag already has a parent.
The element to append. Must not already have a parent.
ListInsert(int, EchoObject)
tag at index and shifts all subsequent elements’ ListIndex values up by one.
The zero-based insertion position. Must be in
[0, Count].The element to insert. Must not already have a parent.
ListRemove(EchoObject)
tag by reference and removes it, updating all subsequent ListIndex values. No-op if tag is not in the list.
ListRemoveAt(int)
index, clears its parent/index tracking, and shifts subsequent elements.
The zero-based index of the element to remove. Must be in
[0, Count).ListClear()
Parent and ListIndex on each one.
Query Methods
Query methods work across the full tree of anEchoObject and do not require the root to be a specific type.
Find(string)
null if any segment is missing. List segments are parsed as zero-based integers.
A
/-separated path such as "stats/stamina" or "Players/0/Name". An empty or whitespace path returns this.TryFind(string, out EchoObject?)
Find. Returns true and populates tag on success.
GetValue<T>(string, T?)
path and attempts to convert the found node’s value to T via Convert.ChangeType. Returns defaultValue if the path is not found or the conversion fails.
The slash-separated path to the target node.
The value to return when the path does not exist or conversion fails. Defaults to
default(T).GetEchoAt(string)
GetValue<EchoObject>(path).
GetListAt(string)
GetValue<List<EchoObject>>(path).
GetDictionaryAt(string)
GetValue<Dictionary<string, EchoObject>>(path).
Where(Func<EchoObject, bool>)
List nodes, filters list elements; for Compound nodes, filters tag values. Returns an empty enumerable for all other types.
Select<T>(Func<EchoObject, T>)
selector. Behavior mirrors Where — operates on immediate children only.
FindAll(Func<EchoObject, bool>)
predicate, including this node itself if it matches.
Exists(string)
true if Find(path) would return a non-null node.
GetPathsTo(Func<EchoObject, bool>)
predicate.
GetPath()
Parent links upward and joining compound keys/list indices with /.
GetRelativePath(EchoObject, EchoObject)
from to to, where to must be a descendant of from. Throws ArgumentException if to is not reachable from from.
The ancestor node to treat as the path root.
The descendant node to locate.
Delta Methods
Deltas capture the structural differences between twoEchoObject trees as a compact list of named operations, making them ideal for network state synchronization and incremental saves.
CreateDelta(EchoObject, EchoObject)
from (baseline) and to (modified) and produces a compound EchoObject containing an "Operations" list. Each operation is itself a compound describing a SetValue, AddCompoundTag, RemoveCompoundTag, AddListItem, or RemoveListItem action at a specific path.
The original/baseline state.
The modified/target state.
EchoObject containing all operations needed to transform from into to.
ApplyDelta(EchoObject, EchoObject)
delta to a clone of baseline and returns the result. The baseline is not mutated.
The original state to apply the delta to.
A delta produced by
CreateDelta.EchoObject representing baseline after the delta is applied.
I/O Methods — Binary
Binary format is the most compact and fastest format for storage and transmission.WriteToBinary(BinaryWriter, BinarySerializationOptions?)
writer in Echo’s native binary format.
The output writer.
Optional format configuration.
WriteToBinary(FileInfo, BinarySerializationOptions?)
file for writing and serializes this node to it. The stream is disposed automatically.
ReadFromBinary(BinaryReader, BinarySerializationOptions?) (static)
EchoObject from reader.
ReadFromBinary(FileInfo, BinarySerializationOptions?) (static)
file, reads an EchoObject, and returns it. The stream is disposed automatically.
I/O Methods — Text
The Echo text format is human-readable and suitable for configuration files and debugging.WriteToString()
WriteToString(FileInfo)
file in Echo text format.
ReadFromString(string) (static)
EchoObject.
ReadFromString(FileInfo) (static)
EchoObject.
I/O Methods — Interop Formats
These methods convert betweenEchoObject and widely-used interchange formats, enabling integration with systems that do not speak Echo’s native formats.
JSON
BSON
YAML
XML
Utility
Clone()
Equals(EchoObject?) and Operators
EchoObject instances are equal when they have the same TagType and recursively equal values. For Compound, key-value pairs are compared without regard to insertion order. For ByteArray, a byte-by-byte comparison is performed.