Class CsvParser
public class CsvParser : BaseTableParser
- Inheritance
-
CsvParser
- Inherited Members
Properties
SeparatorChar
Gets or sets the separator char used to separate values. Default is comma, but Excel uses semicolon ';' as a separator for exported CSVs.
public static char SeparatorChar { 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()