Struct BufferWriterSlimEncodingInterpolatedStringHandler
Represents converter of interpolated string directly to a sequence of bytes using the specified encoding.
Inherited Members
Namespace: DotNext.Text
Assembly: DotNext.dll
Syntax
public ref struct BufferWriterSlimEncodingInterpolatedStringHandler
Constructors
View SourceBufferWriterSlimEncodingInterpolatedStringHandler(int, int, ref BufferWriterSlim<byte>, Encoder, Span<char>, IFormatProvider?)
Initializes a new interpolated string handler.
Declaration
public BufferWriterSlimEncodingInterpolatedStringHandler(int literalLength, int formattedCount, ref BufferWriterSlim<byte> writer, Encoder encoder, Span<char> buffer = default, IFormatProvider? provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | literalLength | The total number of characters in known at compile-time. |
| int | formattedCount | The number of placeholders. |
| BufferWriterSlim<byte> | writer | The output buffer. |
| Encoder | encoder | The character encoder. |
| Span<char> | buffer | The preallocated temporary buffer for characters. |
| IFormatProvider | provider | The format provider. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
Properties
View SourceWrittenCount
Gets number of written characters.
Declaration
public readonly int WrittenCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
View SourceAppendFormatted(scoped ReadOnlySpan<char>)
Writes the specified character span to the handler.
Declaration
public void AppendFormatted(scoped ReadOnlySpan<char> value)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<char> | value | The span to write. |
AppendFormatted(scoped ReadOnlySpan<char>, int)
Writes the specified string of chars to the handler.
Declaration
public void AppendFormatted(scoped ReadOnlySpan<char> value, int alignment)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<char> | value | The span to write. |
| int | alignment | Minimum number of characters that should be written for this value. If the value is negative, it indicates left-aligned and the required minimum is the absolute value. |
AppendFormatted<T>(T, int, string?)
Writes the specified value to the handler.
Declaration
public void AppendFormatted<T>(T value, int alignment, string? format = null)
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | The value to write. |
| int | alignment | Minimum number of characters that should be written for this value. If the value is negative, it indicates left-aligned and the required minimum is the absolute value. |
| string | format | The format string. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the value to write. |
AppendFormatted<T>(T, string?)
Writes the specified value to the handler.
Declaration
public void AppendFormatted<T>(T value, string? format)
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | The value to write. |
| string | format | The format string. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the value to write. |
AppendLiteral(string?)
Writes the specified string to the handler.
Declaration
public void AppendLiteral(string? value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The string to write. |