Class CsvParser
Inherited Members
Namespace: Tlumach.Base
Assembly: Tlumach.Base.dll
Syntax
public class CsvParser : BaseTableParser
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.
Declaration
public static char SeparatorChar { get; set; }
Property Value
| Type | Description |
|---|---|
| char |
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
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 |
Overrides
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.
Declaration
protected override void ReadCells(string content, int offset, int lineNumber, List<string> buffer, out int posAfterEnd)
Parameters
| Type | Name | Description |
|---|---|---|
| string | content | The text, from which the cells are read. |
| int | offset | The starting position of the text to read from. |
| int | lineNumber | The current line being processed. Used for error reporting. |
| List<string> | buffer | The container for read cells. |
| int | posAfterEnd | 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. |
Overrides
Use()
Initializes the parser class, making it available for use.
Declaration
public static void Use()