Xui.Core.Memory
Assembly: Xui.Core · C# declarations · Assembly overview
Types
ref struct FillTextInterpolatedStringHandler
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.
[InterpolatedStringHandler]
public ref struct FillTextInterpolatedStringHandler
{
public FillTextInterpolatedStringHandler(int literalLength, int formattedCount);
public void AppendLiteral(string s);
public void AppendFormatted<T>(T value)
where T : ISpanFormattable;
public void AppendFormatted<T>(T value, ReadOnlySpan<char> format)
where T : ISpanFormattable;
public void AppendFormatted<T>(T value, int alignment)
where T : ISpanFormattable;
public void AppendFormatted<T>(T value, int alignment, ReadOnlySpan<char> format)
where T : ISpanFormattable;
public void AppendFormatted(ReadOnlySpan<char> value);
public void AppendFormatted(string? value);
public void AppendFormatted(object? value);
public readonly ReadOnlySpan<char> AsSpan();
public void Dispose();
}
FillTextInterpolatedStringHandler.FillTextInterpolatedStringHandler(int literalLength, int formattedCount)
public FillTextInterpolatedStringHandler(int literalLength, int formattedCount);
Initializes the handler and allocates or rents a buffer of the appropriate size.
literalLength— Total character count of all literal string segments.formattedCount— Number of interpolated holes in the string.
void FillTextInterpolatedStringHandler.AppendFormatted(object? value)
public void AppendFormatted(object? value);
Appends any object by calling ToString().
void FillTextInterpolatedStringHandler.AppendFormatted(ReadOnlySpan<char> value)
public void AppendFormatted(ReadOnlySpan<char> value);
Appends a System.ReadOnlySpan1` of characters directly.
void FillTextInterpolatedStringHandler.AppendFormatted(string? value)
public void AppendFormatted(string? value);
Appends a string value.
void FillTextInterpolatedStringHandler.AppendFormatted<T>(T value)
public void AppendFormatted<T>(T value)
where T : ISpanFormattable;
Appends a span-formattable value using its default format.
void FillTextInterpolatedStringHandler.AppendFormatted<T>(T value, int alignment)
public void AppendFormatted<T>(T value, int alignment)
where T : ISpanFormattable;
Appends a span-formattable value with the specified alignment width.
void FillTextInterpolatedStringHandler.AppendFormatted<T>(T value, int alignment, ReadOnlySpan<char> format)
public void AppendFormatted<T>(T value, int alignment, ReadOnlySpan<char> format)
where T : ISpanFormattable;
Appends a span-formattable value with the specified format and alignment width.
void FillTextInterpolatedStringHandler.AppendFormatted<T>(T value, ReadOnlySpan<char> format)
public void AppendFormatted<T>(T value, ReadOnlySpan<char> format)
where T : ISpanFormattable;
Appends a span-formattable value using the specified format string.
void FillTextInterpolatedStringHandler.AppendLiteral(string s)
public void AppendLiteral(string s);
Appends a literal string segment to the buffer.
readonly ReadOnlySpan<char> FillTextInterpolatedStringHandler.AsSpan()
public readonly ReadOnlySpan<char> AsSpan();
Returns the currently accumulated characters as a read-only span.
void FillTextInterpolatedStringHandler.Dispose()
public void Dispose();
Returns any rented array buffer back to the pool.