Table of Contents

Struct FillTextInterpolatedStringHandler

Namespace
Xui.Core.Memory
Assembly
Xui.Core.dll

Low-allocation interpolated string handler for building text in a stack-first inline buffer, spilling to a rented array only when the text exceeds 256 characters.

public ref struct FillTextInterpolatedStringHandler
Inherited Members

Constructors

FillTextInterpolatedStringHandler(int, int)

Initializes the handler and allocates or rents a buffer of the appropriate size.

public FillTextInterpolatedStringHandler(int literalLength, int formattedCount)

Parameters

literalLength int

Total character count of all literal string segments.

formattedCount int

Number of interpolated holes in the string.

Methods

AppendFormatted(object?)

Appends any object by calling ToString().

public void AppendFormatted(object? value)

Parameters

value object

AppendFormatted(ReadOnlySpan<char>)

Appends a ReadOnlySpan<T> of characters directly.

public void AppendFormatted(ReadOnlySpan<char> value)

Parameters

value ReadOnlySpan<char>

AppendFormatted(string?)

Appends a string value.

public void AppendFormatted(string? value)

Parameters

value string

AppendFormatted<T>(T)

Appends a span-formattable value using its default format.

public void AppendFormatted<T>(T value) where T : ISpanFormattable

Parameters

value T

Type Parameters

T

AppendFormatted<T>(T, int)

Appends a span-formattable value with the specified alignment width.

public void AppendFormatted<T>(T value, int alignment) where T : ISpanFormattable

Parameters

value T
alignment int

Type Parameters

T

AppendFormatted<T>(T, int, ReadOnlySpan<char>)

Appends a span-formattable value with the specified format and alignment width.

public void AppendFormatted<T>(T value, int alignment, ReadOnlySpan<char> format) where T : ISpanFormattable

Parameters

value T
alignment int
format ReadOnlySpan<char>

Type Parameters

T

AppendFormatted<T>(T, ReadOnlySpan<char>)

Appends a span-formattable value using the specified format string.

public void AppendFormatted<T>(T value, ReadOnlySpan<char> format) where T : ISpanFormattable

Parameters

value T
format ReadOnlySpan<char>

Type Parameters

T

AppendLiteral(string)

Appends a literal string segment to the buffer.

public void AppendLiteral(string s)

Parameters

s string

AsSpan()

Returns the currently accumulated characters as a read-only span.

public readonly ReadOnlySpan<char> AsSpan()

Returns

ReadOnlySpan<char>

Dispose()

Returns any rented array buffer back to the pool.

public void Dispose()