C# Class SmartFormat.Core.Parsing.Parser

Parses a format string.
Datei anzeigen Open project: scottrippey/SmartFormat.NET Class Usage Examples

Public Methods

Method Description
AddAdditionalSelectorChars ( string chars ) : void

Adds specific characters to the allowed selector chars.

AddAlphanumericSelectors ( ) : void

Includes a-z and A-Z in the list of allowed selector chars.

AddOperators ( string chars ) : void

Adds specific characters to the allowed operator chars. An operator is a character that is in the selector string that splits the selectors.

ParseFormat ( string format, string formatterExtensionNames ) : Format
Parser ( ErrorAction errorAction = ErrorAction.Ignore ) : System
UseAlternativeBraces ( char opening, char closing ) : void
UseAlternativeEscapeChar ( char alternativeEscapeChar = '\\' ) : void

Sets the AlternativeEscaping option to True so that braces will only be escaped after the specified character.

UseBraceEscaping ( ) : void

[Default] Uses {{ and }} for escaping braces for compatibility with String.Format. However, this does not work very well with nested placeholders, so it is recommended to use an alternative escape char.

Private Methods

Method Description
FormatterNameExists ( string name, string formatterExtensionNames ) : bool

Method Details

AddAdditionalSelectorChars() public method

Adds specific characters to the allowed selector chars.
public AddAdditionalSelectorChars ( string chars ) : void
chars string
return void

AddAlphanumericSelectors() public method

Includes a-z and A-Z in the list of allowed selector chars.
public AddAlphanumericSelectors ( ) : void
return void

AddOperators() public method

Adds specific characters to the allowed operator chars. An operator is a character that is in the selector string that splits the selectors.
public AddOperators ( string chars ) : void
chars string
return void

ParseFormat() public method

public ParseFormat ( string format, string formatterExtensionNames ) : Format
format string
formatterExtensionNames string
return Format

Parser() public method

public Parser ( ErrorAction errorAction = ErrorAction.Ignore ) : System
errorAction ErrorAction
return System

UseAlternativeBraces() public method

public UseAlternativeBraces ( char opening, char closing ) : void
opening char
closing char
return void

UseAlternativeEscapeChar() public method

Sets the AlternativeEscaping option to True so that braces will only be escaped after the specified character.
public UseAlternativeEscapeChar ( char alternativeEscapeChar = '\\' ) : void
alternativeEscapeChar char Defaults to backslash
return void

UseBraceEscaping() public method

[Default] Uses {{ and }} for escaping braces for compatibility with String.Format. However, this does not work very well with nested placeholders, so it is recommended to use an alternative escape char.
public UseBraceEscaping ( ) : void
return void