Skip to content

Commit

Permalink
feat: undefined chars supported in configuration builders (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
Seddryck authored Dec 27, 2024
1 parent 592d71e commit 54134b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PocketCsvReader/Configuration/DialectDescriptorBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public DialectDescriptorBuilder WithLineTerminator(LineTerminator lineTerminator
};
return WithLineTerminator(terminator);
}
public DialectDescriptorBuilder WithQuoteChar(char quoteChar)
public DialectDescriptorBuilder WithQuoteChar(char? quoteChar)
=> (Descriptor = Descriptor with { QuoteChar = quoteChar }, Builder: this).Builder;
public DialectDescriptorBuilder WithQuoteChar(QuoteChar quoteChar)
=> WithQuoteChar((char)quoteChar);
Expand All @@ -37,7 +37,7 @@ public DialectDescriptorBuilder WithDoubleQuote(bool doubleQuote = true)
=> (Descriptor = Descriptor with { DoubleQuote = doubleQuote }, Builder: this).Builder;
public DialectDescriptorBuilder WithoutDoubleQuote()
=> WithDoubleQuote(false);
public DialectDescriptorBuilder WithEscapeChar(char escapeChar)
public DialectDescriptorBuilder WithEscapeChar(char? escapeChar)
=> (Descriptor = Descriptor with { EscapeChar = escapeChar}, Builder: this).Builder;
public DialectDescriptorBuilder WithEscapeChar(EscapeChar escapeChar)
=> WithEscapeChar((char)escapeChar);
Expand Down Expand Up @@ -69,13 +69,13 @@ public DialectDescriptorBuilder WithHeaderJoin(string join)
=> (Descriptor = Descriptor with { HeaderJoin = join }, Builder: this).Builder;
public DialectDescriptorBuilder WithHeaderRows(int[] headerRows)
{
if (headerRows.Length == 0)
if (headerRows is null || headerRows.Length == 0)
return WithoutHeader();
return (Descriptor = Descriptor with { HeaderRows = headerRows }, Builder: this).Builder;
}
public DialectDescriptorBuilder WithoutHeaderRows()
=> WithHeaderRows([]);
public DialectDescriptorBuilder WithCommentChar(char commentChar)
public DialectDescriptorBuilder WithCommentChar(char? commentChar)
=> (Descriptor = Descriptor with { CommentChar = commentChar}, Builder: this).Builder;
public DialectDescriptorBuilder WithCommentChar(CommentChar commentChar)
=> WithCommentChar((char)commentChar);
Expand Down

0 comments on commit 54134b4

Please sign in to comment.