Show / Hide Table of Contents

Struct BufferWriterInterpolatedStringHandler

Represents handler of the interpolated string that can be written to IBufferWriter<T> without temporary allocations.

Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: DotNext.Text
Assembly: DotNext.dll
Syntax
public struct BufferWriterInterpolatedStringHandler

Constructors

View Source

BufferWriterInterpolatedStringHandler(int, int, IBufferWriter<char>, IFormatProvider?)

Initializes a new interpolated string handler.

Declaration
public BufferWriterInterpolatedStringHandler(int literalLength, int formattedCount, IBufferWriter<char> writer, 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.

IBufferWriter<char> writer

The output buffer.

IFormatProvider provider

Optional formatting provider.

Properties

View Source

WrittenCount

Gets number of written characters.

Declaration
public readonly int WrittenCount { get; }
Property Value
Type Description
int

Methods

View Source

AppendFormatted(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.

View Source

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.

View Source

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.

View Source

AppendFormatted<T>(T, string?)

Writes the specified value to the handler.

Declaration
public void AppendFormatted<T>(T value, string? format = null)
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.

View Source

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.

Extension Methods

BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾