Table of Contents

Class ArgumentParserBase

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public abstract class ArgumentParserBase : ICommandArgumentParser
Inheritance
ArgumentParserBase
Implements
Derived
Inherited Members
Extension Methods

Constructors

ArgumentParserBase(string, bool)

protected ArgumentParserBase(string argName, bool isMandatoryArg)

Parameters

argName string
isMandatoryArg bool

Fields

argCount

protected int argCount

Field Value

int

argName

protected string argName

Field Value

string

isMandatoryArg

protected bool isMandatoryArg

Field Value

bool

lastErrorMessage

protected string lastErrorMessage

Field Value

string

Properties

ArgCount

Return -1 to ignore arg count checking

public int ArgCount { get; }

Property Value

int

ArgumentName

public string ArgumentName { get; }

Property Value

string

IsMandatoryArg

public bool IsMandatoryArg { get; }

Property Value

bool

IsMissing

public bool IsMissing { get; set; }

Property Value

bool

LastErrorMessage

public string LastErrorMessage { get; }

Property Value

string

Methods

GetLastError()

public virtual string GetLastError()

Returns

string

GetSyntax()

public virtual string GetSyntax()

Returns

string

GetSyntaxExplanation(string)

public virtual string GetSyntaxExplanation(string indent)

Parameters

indent string

Returns

string

GetSyntaxUnformatted()

public virtual string GetSyntaxUnformatted()

Returns

string

GetValidRange(CmdArgs)

public virtual string[] GetValidRange(CmdArgs args)

Parameters

args CmdArgs

Returns

string[]

GetValue()

public abstract object GetValue()

Returns

object

PreProcess(TextCommandCallingArgs)

public virtual void PreProcess(TextCommandCallingArgs args)

Parameters

args TextCommandCallingArgs

SetValue(object)

Used by the async system

public abstract void SetValue(object data)

Parameters

data object

TryProcess(TextCommandCallingArgs, Action<AsyncParseResults>)

Parse the args.

public abstract EnumParseResult TryProcess(TextCommandCallingArgs args, Action<AsyncParseResults> onReady = null)

Parameters

args TextCommandCallingArgs
onReady Action<AsyncParseResults>

Only needs to be called when returning Deferred as parseresult

Returns

EnumParseResult

parseSubArgs(string)

protected Dictionary<string, string> parseSubArgs(string strargs)

Parameters

strargs string

Returns

Dictionary<string, string>