Char, not string

This commit is contained in:
Matt Nadareski
2020-06-14 20:33:06 -07:00
parent d60dcad323
commit c070167eb9
6 changed files with 8 additions and 8 deletions

View File

@@ -124,7 +124,7 @@ namespace SabreTools.Library.DatFiles
SeparatedValueWriter svw = new SeparatedValueWriter(fs, new UTF8Encoding(false));
svw.Quotes = false;
svw.Separator = ";";
svw.Separator = ';';
svw.VerifyFieldCount = true;
// Write out the header

View File

@@ -108,7 +108,7 @@ namespace SabreTools.Library.DatFiles
SeparatedValueWriter svw = new SeparatedValueWriter(fs, new UTF8Encoding(false));
svw.Quotes = false;
svw.Separator = "\t";
svw.Separator = '\t';
svw.VerifyFieldCount = true;
// Get a properly sorted set of keys

View File

@@ -124,7 +124,7 @@ namespace SabreTools.Library.DatFiles
SeparatedValueWriter svw = new SeparatedValueWriter(fs, new UTF8Encoding(false));
svw.Quotes = false;
svw.Separator = " ";
svw.Separator = ' ';
svw.VerifyFieldCount = true;
// Get a properly sorted set of keys

View File

@@ -397,7 +397,7 @@ namespace SabreTools.Library.DatFiles
SeparatedValueWriter svw = new SeparatedValueWriter(fs, new UTF8Encoding(false));
svw.Quotes = true;
svw.Separator = this._delim.ToString();
svw.Separator = this._delim;
svw.VerifyFieldCount = true;
// Write out the header

View File

@@ -134,7 +134,7 @@ namespace SabreTools.Library.Readers
}
/// <summary>
/// Dispose of the reader
/// Dispose of the underlying reader
/// </summary>
public void Dispose()
{

View File

@@ -32,9 +32,9 @@ namespace SabreTools.Library.Writers
public bool Quotes { get; set; } = true;
/// <summary>
/// Set what string should be used as a separator
/// Set what character should be used as a separator
/// </summary>
public string Separator { get; set; } = ",";
public char Separator { get; set; } = ',';
/// <summary>
/// Set if field count should be verified from the first row
@@ -79,7 +79,7 @@ namespace SabreTools.Library.Writers
throw new ArgumentException(nameof(sw));
// If the separator character is invalid, we error
if (string.IsNullOrEmpty(Separator))
if (Separator == default(char))
throw new ArgumentException(nameof(Separator));
// If we have the first row, set the bool and the field count