Struct DiagnosticInterpolatedStringHandler
- Namespace
- SwiftCollections.Diagnostics
- Assembly
- SwiftCollections.dll
Builds diagnostic messages for enabled diagnostic levels while allowing disabled levels to skip formatted interpolation expression evaluation.
public ref struct DiagnosticInterpolatedStringHandler
- Inherited Members
Constructors
DiagnosticInterpolatedStringHandler(int, int, DiagnosticChannel, DiagnosticLevel, out bool)
Initializes a new instance of the DiagnosticInterpolatedStringHandler struct.
public DiagnosticInterpolatedStringHandler(int literalLength, int formattedCount, DiagnosticChannel channel, DiagnosticLevel level, out bool isEnabled)
Parameters
literalLengthintThe combined length of literal portions in the interpolated string.
formattedCountintThe number of formatted expressions in the interpolated string.
channelDiagnosticChannelThe diagnostic channel that will receive the message.
levelDiagnosticLevelThe severity level being evaluated.
isEnabledboolSet to
truewhen formatted expressions should be evaluated; otherwise,false.
Properties
IsEnabled
Gets a value indicating whether this handler is actively building a diagnostic message.
public bool IsEnabled { get; }
Property Value
Methods
AppendFormatted(ReadOnlySpan<char>)
Appends a character span.
public void AppendFormatted(ReadOnlySpan<char> value)
Parameters
valueReadOnlySpan<char>The span to append.
AppendFormatted(ReadOnlySpan<char>, int)
Appends a character span with the specified alignment.
public void AppendFormatted(ReadOnlySpan<char> value, int alignment)
Parameters
valueReadOnlySpan<char>The span to append.
alignmentintThe minimum width for the formatted value.
AppendFormatted(ReadOnlySpan<char>, int, string?)
Appends a character span with the specified alignment and format string.
public void AppendFormatted(ReadOnlySpan<char> value, int alignment, string? format)
Parameters
valueReadOnlySpan<char>The span to append.
alignmentintThe minimum width for the formatted value.
formatstringThe format string to apply.
AppendFormatted(string?)
Appends a string value.
public void AppendFormatted(string? value)
Parameters
valuestringThe value to append.
AppendFormatted(string?, int)
Appends a string value with the specified alignment.
public void AppendFormatted(string? value, int alignment)
Parameters
AppendFormatted(string?, int, string?)
Appends a string value with the specified alignment and format string.
public void AppendFormatted(string? value, int alignment, string? format)
Parameters
valuestringThe value to append.
alignmentintThe minimum width for the formatted value.
formatstringThe format string to apply.
AppendFormatted<T>(T)
Appends a formatted value.
public void AppendFormatted<T>(T value)
Parameters
valueTThe value to append.
Type Parameters
TThe type of value to append.
AppendFormatted<T>(T, int)
Appends a formatted value with the specified alignment.
public void AppendFormatted<T>(T value, int alignment)
Parameters
valueTThe value to append.
alignmentintThe minimum width for the formatted value.
Type Parameters
TThe type of value to append.
AppendFormatted<T>(T, int, string?)
Appends a formatted value with the specified alignment and format string.
public void AppendFormatted<T>(T value, int alignment, string? format)
Parameters
valueTThe value to append.
alignmentintThe minimum width for the formatted value.
formatstringThe format string to apply.
Type Parameters
TThe type of value to append.
AppendFormatted<T>(T, string?)
Appends a formatted value using the specified format string.
public void AppendFormatted<T>(T value, string? format)
Parameters
valueTThe value to append.
formatstringThe format string to apply.
Type Parameters
TThe type of value to append.
AppendLiteral(string)
Appends a literal string segment.
public void AppendLiteral(string value)
Parameters
valuestringThe literal string segment.