-
Notifications
You must be signed in to change notification settings - Fork 28
/
SepWriterOptions.cs
32 lines (28 loc) · 875 Bytes
/
SepWriterOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Globalization;
namespace nietras.SeparatedValues;
public readonly record struct SepWriterOptions
{
public SepWriterOptions() : this(Sep.Default) { }
public SepWriterOptions(Sep sep)
{
Sep = sep;
CultureInfo = SepDefaults.CultureInfo;
WriteHeader = true;
}
/// <summary>
/// Specifies the separator used.
/// </summary>
public Sep Sep { get; init; }
/// <summary>
/// Specifies the culture used for parsing.
/// May be `null` for default culture.
/// </summary>
public CultureInfo? CultureInfo { get; init; }
/// <summary>
/// Specifies whether to write a header row
/// before data rows. Requires all columns
/// to have a name. Otherwise, columns can be
/// added by indexing alone.
/// </summary>
public bool WriteHeader { get; init; } = true;
}