IParserConfiguration Interface
Configuration used for the IParser.
graph BT Type["IParserConfiguration"] class Type type-node Implementing0["IReaderConfiguration"]-.->Type click Implementing0 "/CsvHelper/api/CsvHelper.Configuration/IReaderConfiguration" Implementing1["CsvConfiguration"]-.->Type click Implementing1 "/CsvHelper/api/CsvHelper.Configuration/CsvConfiguration"

Syntax

public interface IParserConfiguration

Properties

Name Property Type Summary
AllowComments bool
Gets a value indicating if comments are allowed. true to allow commented out lines, otherwise false.
BadDataFound BadDataFound
Gets the function that is called when bad field data is found. A field has bad data if it contains a quote and the field is not quoted (escaped). You can supply your own function to do other things like logging the issue instead of throwing an exception.
BufferSize int
Gets the size of the buffer used for parsing and writing CSV files. Default is 0x1000.
CacheFields bool
Cache fields that are created when parsing. Default is false.
Comment char
Gets the character used to denote a line that is commented out. Default is '#'.
CountBytes bool
Gets a value indicating whether the number of bytes should be counted while parsing. Default is false. This will slow down parsing because it needs to get the byte count of every char for the given encoding. The Encoding needs to be set correctly for this to be accurate.
CultureInfo CultureInfo
Gets the culture info used to read an write CSV files.
Delimiter string
The delimiter used to separate fields. Default is System.Globalization.TextInfo.ListSeparator.
DetectDelimiter bool
Detect the delimiter instead of using the delimiter from configuration. Default is false.
DetectDelimiterValues string[]
The possible delimiter values used when detecting the delimiter. Default is [",", ";", "|", "\t"].
Encoding Encoding
Gets the encoding used when counting bytes.
Escape char
The character used to escape characters. Default is '"'.
ExceptionMessagesContainRawData bool
A value indicating if exception messages contain raw CSV data. true if exception contain raw CSV data, otherwise false. Default is true.
GetDelimiter GetDelimiter
Gets the function that is called when DetectDelimiter is enabled.
IgnoreBlankLines bool
Gets a value indicating if blank lines should be ignored when reading. true to ignore, otherwise false. Default is true.
IsNewLineSet bool
A value indicating if NewLine was set.
LineBreakInQuotedFieldIsBadData bool
Gets a value indicating if a line break found in a quote field should be considered bad data. true to consider a line break bad data, otherwise false. Defaults to false.
MaxFieldSize double
Gets or sets the maximum size of a field. Defaults to 0, indicating maximum field size is not checked.
Mode CsvMode
The mode. See CsvMode for more details.
NewLine string
The newline string to use. Default is \r\n (CRLF). When writing, this value is always used. When reading, this value is only used if explicitly set. If not set, the parser uses one of \r\n, \r, or \n.
ProcessFieldBufferSize int
The size of the buffer used when processing fields. Default is 1024.
Quote char
Gets the character used to quote fields. Default is '"'.
TrimOptions TrimOptions
Gets the field trimming options.
WhiteSpaceChars char[]
Characters considered whitespace. Used when trimming fields. Default is [' '].

Methods

Name Return Value Summary
Validate() void
Validates the configuration.