Logo ProcessKit API Reference

TryParser<'T> Type

A C#-friendly parser for the `TryParse` verbs: the standard .NET `bool TryX(string, out T)` shape, so C# can pass a BCL parser like `int.TryParse` / `DateTime.TryParse`. Give the verb an explicit type argument — `cmd.TryParseAsync<int>(int.TryParse)` — or assign the parser to a `TryParser<int>` first; the explicit `'T` is required because BCL `TryParse` methods are overloaded (and C# can't infer `'T` from a byref lambda parameter either). It returns `true` and sets `value` on success, `false` otherwise — a `false` result becomes `ProcessError.Parse`. For a custom error *message*, throw from a `Parse` parser, or use the `Result`-returning `Runner.tryParse` from F#.

Instance members

Instance member Description

this.Invoke

Full Usage: this.Invoke

Parameters:
    input : string
    value : byref<'T>

Returns: bool
Modifiers: abstract
input : string
value : byref<'T>
Returns: bool

Type something to start searching.