Show / Hide Table of Contents

Class CharBuffer

Providers extension methods to work with char buffers.

Inheritance
object
CharBuffer
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DotNext.Buffers
Assembly: DotNext.dll
Syntax
public static class CharBuffer

Methods

| Edit this page View Source

Concat(ref BufferWriterSlim<char>, scoped ReadOnlySpan<string?>)

Writes concatenated strings.

Declaration
public static void Concat(this ref BufferWriterSlim<char> writer, scoped ReadOnlySpan<string?> values)
Parameters
Type Name Description
BufferWriterSlim<char> writer

The buffer writer.

ReadOnlySpan<string> values

An array of strings.

Exceptions
Type Condition
OutOfMemoryException

The concatenated string is too large.

| Edit this page View Source

Concat(IBufferWriter<char>, scoped ReadOnlySpan<string?>)

Writes concatenated strings.

Declaration
public static void Concat(this IBufferWriter<char> writer, scoped ReadOnlySpan<string?> values)
Parameters
Type Name Description
IBufferWriter<char> writer

The buffer writer.

ReadOnlySpan<string> values

An array of strings.

Exceptions
Type Condition
OutOfMemoryException

The concatenated string is too large.

| Edit this page View Source

Format(ref BufferWriterSlim<char>, CompositeFormat, scoped ReadOnlySpan<object?>, IFormatProvider?)

Writes formatted string to the buffer.

Declaration
public static int Format(this ref BufferWriterSlim<char> writer, CompositeFormat format, scoped ReadOnlySpan<object?> args, IFormatProvider? provider = null)
Parameters
Type Name Description
BufferWriterSlim<char> writer

The buffer writer.

CompositeFormat format

Formatting template.

ReadOnlySpan<object> args

The arguments to be rendered as a part of template.

IFormatProvider provider

A culture-specific formatting information.

Returns
Type Description
int

The number of written characters.

Exceptions
Type Condition
InsufficientMemoryException

writer has not enough space to place rendered template.

| Edit this page View Source

Format(IBufferWriter<char>, CompositeFormat, ReadOnlySpan<object?>, IFormatProvider?)

Writes formatted string to the buffer.

Declaration
public static int Format(this IBufferWriter<char> writer, CompositeFormat format, ReadOnlySpan<object?> args, IFormatProvider? provider = null)
Parameters
Type Name Description
IBufferWriter<char> writer

The buffer writer.

CompositeFormat format

Formatting template.

ReadOnlySpan<object> args

The arguments to be rendered as a part of template.

IFormatProvider provider

A culture-specific formatting information.

Returns
Type Description
int

The number of written characters.

Exceptions
Type Condition
InsufficientMemoryException

writer has not enough space to place rendered template.

| Edit this page View Source

Format<T>(ref BufferWriterSlim<char>, T, string?, IFormatProvider?)

Writes the value as a string.

Declaration
public static int Format<T>(this ref BufferWriterSlim<char> writer, T value, string? format = null, IFormatProvider? provider = null)
Parameters
Type Name Description
BufferWriterSlim<char> writer

The buffer writer.

T value

The value to convert.

string format

The format of the value.

IFormatProvider provider

The format provider.

Returns
Type Description
int

The number of written characters.

Type Parameters
Name Description
T

The type of the value.

| Edit this page View Source

Format<T>(IBufferWriter<char>, T, string?, IFormatProvider?)

Writes the value as a string.

Declaration
public static int Format<T>(this IBufferWriter<char> writer, T value, string? format = null, IFormatProvider? provider = null)
Parameters
Type Name Description
IBufferWriter<char> writer

The buffer writer.

T value

The value to convert.

string format

The format of the value.

IFormatProvider provider

The format provider.

Returns
Type Description
int

The number of written characters.

Type Parameters
Name Description
T

The type of the value.

| Edit this page View Source

Interpolate(ref BufferWriterSlim<char>, scoped in BufferWriterSlimInterpolatedStringHandler)

Writes interpolated string to the buffer.

Declaration
public static int Interpolate(this ref BufferWriterSlim<char> writer, scoped in BufferWriterSlimInterpolatedStringHandler handler)
Parameters
Type Name Description
BufferWriterSlim<char> writer

The buffer writer.

BufferWriterSlimInterpolatedStringHandler handler

The handler of the interpolated string.

Returns
Type Description
int

The number of written characters.

| Edit this page View Source

Interpolate(ref BufferWriterSlim<char>, IFormatProvider?, scoped in BufferWriterSlimInterpolatedStringHandler)

Writes interpolated string to the buffer.

Declaration
public static int Interpolate(this ref BufferWriterSlim<char> writer, IFormatProvider? provider, scoped in BufferWriterSlimInterpolatedStringHandler handler)
Parameters
Type Name Description
BufferWriterSlim<char> writer

The buffer writer.

IFormatProvider provider

The formatting provider.

BufferWriterSlimInterpolatedStringHandler handler

The handler of the interpolated string.

Returns
Type Description
int

The number of written characters.

| Edit this page View Source

Interpolate(IBufferWriter<char>, in BufferWriterInterpolatedStringHandler)

Writes interpolated string to the buffer.

Declaration
public static int Interpolate(this IBufferWriter<char> writer, in BufferWriterInterpolatedStringHandler handler)
Parameters
Type Name Description
IBufferWriter<char> writer

The buffer writer.

BufferWriterInterpolatedStringHandler handler

The handler of the interpolated string.

Returns
Type Description
int

The number of written characters.

| Edit this page View Source

Interpolate(IBufferWriter<char>, IFormatProvider?, in BufferWriterInterpolatedStringHandler)

Writes interpolated string to the buffer.

Declaration
public static int Interpolate(this IBufferWriter<char> writer, IFormatProvider? provider, in BufferWriterInterpolatedStringHandler handler)
Parameters
Type Name Description
IBufferWriter<char> writer

The buffer writer.

IFormatProvider provider

The formatting provider.

BufferWriterInterpolatedStringHandler handler

The handler of the interpolated string.

Returns
Type Description
int

The number of written characters.

| Edit this page View Source

TryFormat(ref SpanWriter<char>, CompositeFormat, scoped ReadOnlySpan<object?>, IFormatProvider?)

Tries to write formatted string to the buffer.

Declaration
public static bool TryFormat(this ref SpanWriter<char> writer, CompositeFormat format, scoped ReadOnlySpan<object?> args, IFormatProvider? provider = null)
Parameters
Type Name Description
SpanWriter<char> writer

The buffer writer.

CompositeFormat format

Formatting template.

ReadOnlySpan<object> args

The arguments to be rendered as a part of template.

IFormatProvider provider

A culture-specific formatting information.

Returns
Type Description
bool

true if writer has enough free space to place rendered string; otherwise, false.

| Edit this page View Source

TryFormat<T>(ref SpanWriter<char>, T, scoped ReadOnlySpan<char>, IFormatProvider?)

Converts the value to a set of characters and writes them to the buffer.

Declaration
public static bool TryFormat<T>(this ref SpanWriter<char> writer, T value, scoped ReadOnlySpan<char> format = default, IFormatProvider? provider = null) where T : ISpanFormattable
Parameters
Type Name Description
SpanWriter<char> writer

The buffer writer.

T value

The value to be converted to a set of characters.

ReadOnlySpan<char> format

The format of the value.

IFormatProvider provider

The format provider.

Returns
Type Description
bool

true if writer has enough space to place the value; otherwise, false.

Type Parameters
Name Description
T

The formattable type.

| Edit this page View Source

Write(ref BufferWriterSlim<char>, StringBuilder)

Writes the contents of string builder to the buffer.

Declaration
public static void Write(this ref BufferWriterSlim<char> writer, StringBuilder input)
Parameters
Type Name Description
BufferWriterSlim<char> writer

The buffer writer.

StringBuilder input

The string builder.

| Edit this page View Source

Write(ref SpanWriter<char>, StringBuilder)

Writes the contents of a string builder to the buffer.

Declaration
public static void Write(this ref SpanWriter<char> writer, StringBuilder input)
Parameters
Type Name Description
SpanWriter<char> writer

The buffer writer.

StringBuilder input

The string builder.

| Edit this page View Source

Write(IBufferWriter<char>, StringBuilder)

Writes the contents of string builder to the buffer.

Declaration
public static void Write(this IBufferWriter<char> writer, StringBuilder input)
Parameters
Type Name Description
IBufferWriter<char> writer

The buffer writer.

StringBuilder input

The string builder.

| Edit this page View Source

WriteLine(ref BufferWriterSlim<char>)

Writes line termination symbols to the buffer.

Declaration
public static void WriteLine(this ref BufferWriterSlim<char> writer)
Parameters
Type Name Description
BufferWriterSlim<char> writer

The buffer writer.

| Edit this page View Source

WriteLine(ref BufferWriterSlim<char>, scoped ReadOnlySpan<char>)

Writes a string to the buffer, followed by a line terminator.

Declaration
public static void WriteLine(this ref BufferWriterSlim<char> writer, scoped ReadOnlySpan<char> characters)
Parameters
Type Name Description
BufferWriterSlim<char> writer

The buffer writer.

ReadOnlySpan<char> characters

The characters to write.

| Edit this page View Source

WriteLine(IBufferWriter<char>)

Writes line termination symbols to the buffer.

Declaration
public static void WriteLine(this IBufferWriter<char> writer)
Parameters
Type Name Description
IBufferWriter<char> writer

The buffer writer.

| Edit this page View Source

WriteLine(IBufferWriter<char>, scoped ReadOnlySpan<char>)

Writes a string to the buffer, followed by a line terminator.

Declaration
public static void WriteLine(this IBufferWriter<char> writer, scoped ReadOnlySpan<char> characters)
Parameters
Type Name Description
IBufferWriter<char> writer

The buffer writer.

ReadOnlySpan<char> characters

The characters to write.

  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾