Tlumach
  • Articles
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Tlumach
      • Base
        • ArbParser
        • ArbPlaceholder
        • BaseGenerator
        • BaseJsonParser
        • BaseKeyValueParser
        • BaseParser
        • BaseTableParser
        • BaseXMLParser
        • CsvParser
        • CultureNameMatchEventArgs
        • FileFormats
        • GenericParserException
        • IniParser
        • JsonParser
        • ParserConfigException
        • ParserFileException
        • ParserLoadException
        • Placeholder
        • ResxParser
        • TemplateParserException
        • TemplateProcessingException
        • TextFileParseException
        • TextFormat
        • TextParseException
        • TlumachException
        • TomlParser
        • Translation
        • TranslationConfiguration
        • TranslationEntry
        • TranslationTree
        • TranslationTreeLeaf
        • TranslationTreeNode
        • TsvParser
        • Utils
      • BaseTranslationUnit
      • CultureChangedEventArgs
      • FileContentNeededEventArgs
      • TemplatedTranslationUnit
      • TranslationManager
      • TranslationUnit
      • TranslationValueEventArgs

    Class TomlParser

    The parser for TOML translation files.

    Inheritance
    object
    BaseParser
    BaseKeyValueParser
    TomlParser
    Inherited Members
    BaseKeyValueParser.LocaleSeparatorChar
    BaseKeyValueParser.GetLocaleSeparatorChar()
    BaseKeyValueParser.LoadTranslation(string, CultureInfo)
    BaseKeyValueParser.ParseConfiguration(string, Assembly)
    BaseKeyValueParser.InternalLoadTranslationStructure(string)
    BaseParser.RecognizeFileRefs
    BaseParser.UseDefaultFileForTranslations
    BaseParser.StringHasParameters(string, TextFormat)
    BaseParser.LoadTranslationStructure(string, string, out TranslationConfiguration)
    BaseParser.ParseConfigurationFile(string)
    BaseParser.ParseConfigurationFile(Assembly, string)
    BaseParser.ValidateConfiguration(TranslationConfiguration)
    BaseParser.GetAbsolutePosition(string, int, int)
    BaseParser.DecodeTextProcessingMode(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Tlumach.Base
    Assembly: Tlumach.Base.dll
    Syntax
    public class TomlParser : BaseKeyValueParser

    Properties

    LineCommentChar

    Declaration
    protected override char LineCommentChar { get; }
    Property Value
    Type Description
    char
    Overrides
    BaseKeyValueParser.LineCommentChar

    TextProcessingMode

    Gets or sets the text processing mode to use when decoding potentially escaped strings and when recognizing template strings in translation entries.

    Declaration
    public static TextFormat TextProcessingMode { get; set; }
    Property Value
    Type Description
    TextFormat

    Methods

    AcceptUnquotedEmptyValues()

    Declaration
    protected override bool AcceptUnquotedEmptyValues()
    Returns
    Type Description
    bool
    Overrides
    BaseKeyValueParser.AcceptUnquotedEmptyValues()

    CanHandleExtension(string)

    Checks whether this parser can handle a translation file with the given extension.

    This method is not used for configuration files.

    Declaration
    public override bool CanHandleExtension(string fileExtension)
    Parameters
    Type Name Description
    string fileExtension

    The extension to check.

    Returns
    Type Description
    bool

    true if the extension is supported and false otherwise.

    Overrides
    BaseParser.CanHandleExtension(string)

    GetTextProcessingMode()

    Declaration
    protected override TextFormat GetTextProcessingMode()
    Returns
    Type Description
    TextFormat
    Overrides
    BaseParser.GetTextProcessingMode()

    IsEndOfKey(string, int, out int)

    Declaration
    protected override bool? IsEndOfKey(string content, int offset, out int newPosition)
    Parameters
    Type Name Description
    string content
    int offset
    int newPosition
    Returns
    Type Description
    bool?
    Overrides
    BaseKeyValueParser.IsEndOfKey(string, int, out int)

    IsEndOfValue(string, int, out int)

    Detects if the end of a value has been reached.

    Declaration
    protected override bool? IsEndOfValue(string content, int offset, out int newPosition)
    Parameters
    Type Name Description
    string content

    content to check.

    int offset

    current position within the content.

    int newPosition

    upon return is set to a position next to the end-of-value marker (indicates to which value the pointer must be set).

    Returns
    Type Description
    bool?

    true if the end of the value has been reached, false if the end has not been reached, and null if the end of line was encountered and a single-line value was not closed.

    Overrides
    BaseKeyValueParser.IsEndOfValue(string, int, out int)
    Exceptions
    Type Condition
    TextParseException

    thrown when an error occurs.

    IsEscapedEOLInValue(string, int)

    Declaration
    protected override bool IsEscapedEOLInValue(string content, int offset)
    Parameters
    Type Name Description
    string content
    int offset
    Returns
    Type Description
    bool
    Overrides
    BaseKeyValueParser.IsEscapedEOLInValue(string, int)

    IsSeparatorChar(char)

    Declaration
    protected override bool IsSeparatorChar(char candidate)
    Parameters
    Type Name Description
    char candidate
    Returns
    Type Description
    bool
    Overrides
    BaseKeyValueParser.IsSeparatorChar(char)

    IsStartOfKey(string, int)

    Declaration
    protected override bool IsStartOfKey(string content, int offset)
    Parameters
    Type Name Description
    string content
    int offset
    Returns
    Type Description
    bool
    Overrides
    BaseKeyValueParser.IsStartOfKey(string, int)

    IsStartOfValue(string, int, out int)

    Declaration
    protected override bool IsStartOfValue(string content, int offset, out int posAfterStart)
    Parameters
    Type Name Description
    string content
    int offset
    int posAfterStart
    Returns
    Type Description
    bool
    Overrides
    BaseKeyValueParser.IsStartOfValue(string, int, out int)

    IsValidKeyChar(string, int)

    Declaration
    protected override bool IsValidKeyChar(string content, int offset)
    Parameters
    Type Name Description
    string content
    int offset
    Returns
    Type Description
    bool
    Overrides
    BaseKeyValueParser.IsValidKeyChar(string, int)

    IsValidSectionNameChar(string, int)

    Declaration
    protected override bool IsValidSectionNameChar(string content, int offset)
    Parameters
    Type Name Description
    string content
    int offset
    Returns
    Type Description
    bool
    Overrides
    BaseKeyValueParser.IsValidSectionNameChar(string, int)

    UnwrapKey(string)

    Strips format-specific markers that denote the beginning and the end of a value.

    Declaration
    protected override string UnwrapKey(string value)
    Parameters
    Type Name Description
    string value

    The value to strip.

    Returns
    Type Description
    string

    The text inside the markers.

    Overrides
    BaseKeyValueParser.UnwrapKey(string)

    UnwrapValue(string)

    Strips format-specific markers that denote the beginning and the end of a value.

    Declaration
    protected override (string? escaped, string unescaped) UnwrapValue(string value)
    Parameters
    Type Name Description
    string value

    The value to strip.

    Returns
    Type Description
    (string escaped, string unescaped)

    The text inside the markers.

    Overrides
    BaseKeyValueParser.UnwrapValue(string)

    Use()

    Initializes the parser class, making it available for use.

    Declaration
    public static void Use()
    In this article
    Back to top Generated by DocFX