Class TsvParser
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
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
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
fileExtensionstringThe extension to check.
Returns
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
contentstringThe content to parse.
textProcessingModeTextFormat?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
contentstringThe text, from which the cells are read.
offsetintThe starting position of the text to read from.
lineNumberintThe current line being processed. Used for error reporting.
bufferList<string>The container for read cells.
posAfterEndintUpon 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()