mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Char, not string
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user