Class Default
The default string parser.
Implements
Inherited Members
Namespace: SadConsole.StringParser
Assembly: SadConsole.dll
Syntax
public class Default : IParser
Constructors
Default()
Declaration
public Default()
Fields
CustomProcessor
Custom processor called before the build in command resolver.
Declaration
public Func<string, string, ColoredGlyphAndEffect[], ICellSurface?, ParseCommandStacks?, ParseCommandBase?>? CustomProcessor
Field Value
Type | Description |
---|---|
Func<string, string, ColoredGlyphAndEffect[], ICellSurface, ParseCommandStacks, ParseCommandBase> |
Remarks
Signature is ("command", "parameters", existing glyphs, text surface, associated editor, command stacks).
Properties
Variables
A dictionary of variable resolution methods.
Declaration
public Dictionary<string, Func<string>> Variables { get; }
Property Value
Type | Description |
---|---|
Dictionary<string, Func<string>> |
Methods
Parse(ReadOnlySpan<char>, int, ICellSurface?, ParseCommandStacks?)
Creates a colored string by parsing commands embedded in the string.
Declaration
public ColoredString Parse(ReadOnlySpan<char> value, int surfaceIndex = -1, ICellSurface? surface = null, ParseCommandStacks? initialBehaviors = null)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<char> | value | The string to parse. |
int | surfaceIndex | Index of where this string will be printed. |
ICellSurface | surface | The surface the string will be printed to. |
ParseCommandStacks | initialBehaviors | Any initial defaults. |
Returns
Type | Description |
---|---|
ColoredString | The finalized string. |