TomlWriter Class

Writes TOML tokens for use by TomlConverter implementations.

public sealed class TomlWriter

Constructors

NameDescription
TomlWriter(TextWriter, TomlSerializerOptions?)Initializes a new instance of the TomlWriter class.

TomlWriter(TextWriter, TomlSerializerOptions?)

TomlWriter.cs

Initializes a new instance of the TomlWriter class.

public TomlWriter(TextWriter writer, TomlSerializerOptions? options = null)

Parameters

writer TextWriter
options TomlSerializerOptions?

Properties

NameDescription
OptionsGets the options instance used by this writer.

Gets the options instance used by this writer.

public TomlSerializerOptions Options { get; }

Property value

TomlSerializerOptions

Methods

NameDescription
WriteBooleanValue(bool)Writes a boolean value.
WriteDateTimeValue(TomlDateTime)Writes a TOML date/time value.
WriteEndArray()Writes the end of an array value.
WriteEndDocument()Writes the end of a TOML document.
WriteEndInlineTable()Writes the end of an inline table value.
WriteEndTable()Writes the end of a table value.
WriteEndTableArray()Writes the end of an array-of-tables value.
WriteFloatValue(double)Writes a floating point value.
WriteFloatValue(float)Writes a single-precision floating point value with its own round-trip formatting.
WriteIntegerValue(long)Writes an integer value.
WritePropertyName(string)Writes a property name within the current table context.
WriteStartArray()Writes the start of an array value.
WriteStartDocument()Writes the start of a TOML document.
WriteStartInlineTable()Writes the start of an inline table value.
WriteStartTable()Writes the start of a table value.
WriteStartTableArray()Writes the start of an array-of-tables value.
WriteStringValue(string)Writes a string value.

WriteBooleanValue(bool)

TomlWriter.cs

Writes a boolean value.

public void WriteBooleanValue(bool value)

Parameters

value bool
The value.

WriteDateTimeValue(TomlDateTime)

TomlWriter.cs

Writes a TOML date/time value.

public void WriteDateTimeValue(TomlDateTime value)

Parameters

value TomlDateTime
The value.

WriteEndArray()

TomlWriter.cs

Writes the end of an array value.

public void WriteEndArray()

WriteEndDocument()

TomlWriter.cs

Writes the end of a TOML document.

public void WriteEndDocument()

WriteEndInlineTable()

TomlWriter.cs

Writes the end of an inline table value.

public void WriteEndInlineTable()

WriteEndTable()

TomlWriter.cs

Writes the end of a table value.

public void WriteEndTable()

WriteEndTableArray()

TomlWriter.cs

Writes the end of an array-of-tables value.

public void WriteEndTableArray()

WriteFloatValue overloads

WriteFloatValue(double)

TomlWriter.cs

Writes a floating point value.

public void WriteFloatValue(double value)
Parameters
value double
The value.

WriteFloatValue(float)

TomlWriter.cs

Writes a single-precision floating point value with its own round-trip formatting.

public void WriteFloatValue(float value)
Parameters
value float
The value.
Remarks

Widening the value to Double would add digits, such as 0.10000000149011612 for 0.1f.

WriteIntegerValue(long)

TomlWriter.cs

Writes an integer value.

public void WriteIntegerValue(long value)

Parameters

value long
The value.

WritePropertyName(string)

TomlWriter.cs

Writes a property name within the current table context.

public void WritePropertyName(string name)

Parameters

name string
The property name.

WriteStartArray()

TomlWriter.cs

Writes the start of an array value.

public void WriteStartArray()

WriteStartDocument()

TomlWriter.cs

Writes the start of a TOML document.

public void WriteStartDocument()

WriteStartInlineTable()

TomlWriter.cs

Writes the start of an inline table value.

public void WriteStartInlineTable()

WriteStartTable()

TomlWriter.cs

Writes the start of a table value.

public void WriteStartTable()

WriteStartTableArray()

TomlWriter.cs

Writes the start of an array-of-tables value.

public void WriteStartTableArray()

Remarks

This method writes an array container whose elements must be tables.

WriteStringValue(string)

TomlWriter.cs

Writes a string value.

public void WriteStringValue(string value)

Parameters

value string
The value.