Class HelperTemplate<T>

Namespace
Elegy.ConsoleSystem.Commands.Helpers
Assembly
Elegy.ConsoleSystem.dll

A template to help you implement IConsoleArgumentHelper.

public abstract class HelperTemplate<T> : IConsoleArgumentHelper

Type Parameters

T
Inheritance
HelperTemplate<T>
Implements
Derived
Inherited Members

Properties

Type

The datatype that the helper works with.

public Type Type { get; }

Property Value

Type

Methods

Parse(ReadOnlySpan<char>)

Parses the argument as a string and resolves it as the appropriate datatype Type.

public abstract object Parse(ReadOnlySpan<char> argument)

Parameters

argument ReadOnlySpan<char>

Returns

object

Validate(ReadOnlySpan<char>, out string?)

Checks if argument can be validated and if not, fills in errorMessage.

public abstract bool Validate(ReadOnlySpan<char> argument, out string? errorMessage)

Parameters

argument ReadOnlySpan<char>
errorMessage string

Returns

bool

true if argument is valid, false otherwise.