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)); SeparatedValueWriter svw = new SeparatedValueWriter(fs, new UTF8Encoding(false));
svw.Quotes = false; svw.Quotes = false;
svw.Separator = ";"; svw.Separator = ';';
svw.VerifyFieldCount = true; svw.VerifyFieldCount = true;
// Write out the header // Write out the header

View File

@@ -108,7 +108,7 @@ namespace SabreTools.Library.DatFiles
SeparatedValueWriter svw = new SeparatedValueWriter(fs, new UTF8Encoding(false)); SeparatedValueWriter svw = new SeparatedValueWriter(fs, new UTF8Encoding(false));
svw.Quotes = false; svw.Quotes = false;
svw.Separator = "\t"; svw.Separator = '\t';
svw.VerifyFieldCount = true; svw.VerifyFieldCount = true;
// Get a properly sorted set of keys // 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)); SeparatedValueWriter svw = new SeparatedValueWriter(fs, new UTF8Encoding(false));
svw.Quotes = false; svw.Quotes = false;
svw.Separator = " "; svw.Separator = ' ';
svw.VerifyFieldCount = true; svw.VerifyFieldCount = true;
// Get a properly sorted set of keys // 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)); SeparatedValueWriter svw = new SeparatedValueWriter(fs, new UTF8Encoding(false));
svw.Quotes = true; svw.Quotes = true;
svw.Separator = this._delim.ToString(); svw.Separator = this._delim;
svw.VerifyFieldCount = true; svw.VerifyFieldCount = true;
// Write out the header // Write out the header

View File

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

View File

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