Table of Contents

Class TsvParser

Namespace
Tlumach.Base
Assembly
Tlumach.Base.dll
public class TsvParser : BaseTableParser
Inheritance
TsvParser
Inherited Members

Properties

ExpectQuotes

Gets or sets the flag that tells the parser whether the TSV file uses quotes to wrap the text with unsafe characters (new-line characters and tabs that are a part of values).

public static bool ExpectQuotes { get; set; }

Property Value

bool

TextProcessingMode

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

public static TextFormat TextProcessingMode { get; set; }

Property Value

TextFormat

Methods

CanHandleExtension(string)

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

This method is not used for configuration files.

public override bool CanHandleExtension(string fileExtension)

Parameters

fileExtension string

The extension to check.

Returns

bool

true if the extension is supported and false otherwise.

InternalLoadTranslationStructure(string, TextFormat?)

Loads the keys from the default translation file and builds a tree of keys.

protected override TranslationTree? InternalLoadTranslationStructure(string content, TextFormat? textProcessingMode)

Parameters

content string

The content to parse.

textProcessingMode TextFormat?

The mode of processing of the text of the default file.

Returns

TranslationTree

The constructed TranslationTree upon success or null otherwise.

Exceptions

TextParseException

Gets thrown when parsing of a default translation file fails.

ReadCells(string, int, int, List<string>, out int)

Reads cells from the provided text starting at position offset.

This is an abstract function overridden by specific parsers which implement the logic or call the ReadCells(string, int, int, List<string>, out int) method with the required parameters for the default implementation.

protected override void ReadCells(string content, int offset, int lineNumber, List<string> buffer, out int posAfterEnd)

Parameters

content string

The text, from which the cells are read.

offset int

The starting position of the text to read from.

lineNumber int

The current line being processed. Used for error reporting.

buffer List<string>

The container for read cells.

posAfterEnd int

Upon return, is set to the position of the first character beyond the read one. EOL characters are skipped, so the value must reference the start of the next line.

Use()

Initializes the parser class, making it available for use.

public static void Use()