Struct ValueStringBuilder
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
Assembly: MediaBrowser.Model.dll
Syntax
public ref struct ValueStringBuilder
Constructors
ValueStringBuilder(Int32)
Declaration
public ValueStringBuilder(int initialCapacity)
Parameters
Type |
Name |
Description |
System.Int32 |
initialCapacity |
|
ValueStringBuilder(Span<Char>)
Declaration
public ValueStringBuilder(Span<char> initialBuffer)
Parameters
Type |
Name |
Description |
System.Span<System.Char> |
initialBuffer |
|
Properties
Capacity
Declaration
public readonly int Capacity { get; }
Property Value
Type |
Description |
System.Int32 |
|
Item[Int32]
Declaration
public readonly ref char this[int index] { get; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Property Value
Type |
Description |
System.Char |
|
Length
Declaration
public int Length { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
RawChars
Returns the underlying storage of the builder.
Declaration
public readonly Span<char> RawChars { get; }
Property Value
Type |
Description |
System.Span<System.Char> |
|
Methods
Append(Char)
Declaration
public void Append(char c)
Parameters
Type |
Name |
Description |
System.Char |
c |
|
Append(Char, Int32)
Declaration
public void Append(char c, int count)
Parameters
Type |
Name |
Description |
System.Char |
c |
|
System.Int32 |
count |
|
Append(ReadOnlySpan<Char>)
Declaration
public void Append(ReadOnlySpan<char> value)
Parameters
Type |
Name |
Description |
System.ReadOnlySpan<System.Char> |
value |
|
Append(String)
Declaration
public void Append(string s)
Parameters
Type |
Name |
Description |
System.String |
s |
|
AppendReversed(ReadOnlySpan<Char>)
Declaration
public void AppendReversed(ReadOnlySpan<char> value)
Parameters
Type |
Name |
Description |
System.ReadOnlySpan<System.Char> |
value |
|
AppendSpan(Int32)
Declaration
public Span<char> AppendSpan(int length)
Parameters
Type |
Name |
Description |
System.Int32 |
length |
|
Returns
Type |
Description |
System.Span<System.Char> |
|
AsSpan()
Declaration
public ReadOnlySpan<char> AsSpan()
Returns
Type |
Description |
System.ReadOnlySpan<System.Char> |
|
AsSpan(Boolean)
Returns a span around the contents of the builder.
Declaration
public ReadOnlySpan<char> AsSpan(bool terminate)
Parameters
Type |
Name |
Description |
System.Boolean |
terminate |
Ensures that the builder has a null char after Length
|
Returns
Type |
Description |
System.ReadOnlySpan<System.Char> |
|
AsSpan(Int32)
Declaration
public ReadOnlySpan<char> AsSpan(int start)
Parameters
Type |
Name |
Description |
System.Int32 |
start |
|
Returns
Type |
Description |
System.ReadOnlySpan<System.Char> |
|
AsSpan(Int32, Int32)
Declaration
public ReadOnlySpan<char> AsSpan(int start, int length)
Parameters
Type |
Name |
Description |
System.Int32 |
start |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.ReadOnlySpan<System.Char> |
|
Dispose()
Declaration
EnsureCapacity(Int32)
Declaration
public void EnsureCapacity(int capacity)
Parameters
Type |
Name |
Description |
System.Int32 |
capacity |
|
GetPinnableReference()
Get a pinnable reference to the builder.
Does not ensure there is a null char after Length
This overload is pattern matched in the C# 7.3+ compiler so you can omit
the explicit method call, and write eg "fixed (char* c = builder)"
Declaration
public ref char GetPinnableReference()
Returns
Type |
Description |
System.Char |
|
GetPinnableReference(Boolean)
Get a pinnable reference to the builder.
Declaration
public ref char GetPinnableReference(bool terminate)
Parameters
Type |
Name |
Description |
System.Boolean |
terminate |
Ensures that the builder has a null char after Length
|
Returns
Type |
Description |
System.Char |
|
Insert(Int32, Char, Int32)
Declaration
public void Insert(int index, char value, int count)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.Char |
value |
|
System.Int32 |
count |
|
Insert(Int32, String)
Declaration
public void Insert(int index, string s)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.String |
s |
|
Reverse()
Declaration
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.ValueType.ToString()
TryCopyTo(Span<Char>, out Int32)
Declaration
public bool TryCopyTo(Span<char> destination, out int charsWritten)
Parameters
Type |
Name |
Description |
System.Span<System.Char> |
destination |
|
System.Int32 |
charsWritten |
|
Returns
Type |
Description |
System.Boolean |
|