C# Class SmartFormat.Core.Parsing.Parser

Parses a format string.
Afficher le fichier Open project: scottrippey/SmartFormat.NET Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
FormatterNameExists ( string name, string formatterExtensionNames ) : bool

Method Details

AddAdditionalSelectorChars() public méthode

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

AddAlphanumericSelectors() public méthode

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

AddOperators() public méthode

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
Résultat void

ParseFormat() public méthode

public ParseFormat ( string format, string formatterExtensionNames ) : Format
format string
formatterExtensionNames string
Résultat Format

Parser() public méthode

public Parser ( ErrorAction errorAction = ErrorAction.Ignore ) : System
errorAction ErrorAction
Résultat System

UseAlternativeBraces() public méthode

public UseAlternativeBraces ( char opening, char closing ) : void
opening char
closing char
Résultat void

UseAlternativeEscapeChar() public méthode

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
Résultat void

UseBraceEscaping() public méthode

[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
Résultat void