Class CliFormatter
- Namespace
- ItTiger.TigerCli.Primitives
- Assembly
- ItTiger.TigerCli.dll
Formats arbitrary cell values before they are escaped or interpreted as markup by the rendering pipeline.
public sealed class CliFormatter
- Inheritance
-
CliFormatter
- Inherited Members
Fields
NoOpFormatter
Formatter that returns
obj?.ToString() ?? string.Empty.public static readonly CliFormatter NoOpFormatter
Field Value
Methods
Clone(CliFormatter?)
Creates a copy of a formatter, or
null when formatter is null.public static CliFormatter? Clone(CliFormatter? formatter)
Parameters
formatterCliFormatter
Returns
Format(object?)
Formats a value;
null formats as an empty string.public string Format(object? value)
Parameters
valueobject
Returns
FromDelegate(Func<object?, string>)
Creates a formatter backed by an application-supplied delegate.
public static CliFormatter FromDelegate(Func<object?, string> formatter)
Parameters
Returns
FromFormatString(string)
Creates a formatter that applies
formatString to IFormattable
values and falls back to ToString() for other values.public static CliFormatter FromFormatString(string formatString)
Parameters
formatStringstring