Class UnsafeStringBuilder
A class similar to StringBuilder, but implemented using unsafe C#.
Implements
Namespace: PostSharp.Patterns.Formatters
Assembly: PostSharp.Patterns.Common.dll
Syntax
public sealed class UnsafeStringBuilder : Object
Constructors
Name | Description |
---|---|
UnsafeStringBuilder(Char*, Int32, Boolean) | Initializes a new UnsafeStringBuilder with a pre-allocated buffer/ |
UnsafeStringBuilder(Int32, Boolean) | Initializes a new UnsafeStringBuilder and allocates a new buffer. |
Properties
Name | Description |
---|---|
Buffer | Gets a pointer to the unmanaged buffer of the current UnsafeStringBuilder. |
Capacity | Gets the capacity (number of |
IsDisposed | Determines whether the current UnsafeStringBuilder has been disposed. |
Item[Int32] | Gets the |
Length | Gets the current number of characters in the current UnsafeStringBuilder. |
ThrowOnOverflow |
|
Version | Gets the version of the current UnsafeStringBuilder. This property is incremented every time the current object is reused, more specifically, when the Clear() method is called. |
Methods
Name | Description |
---|---|
Append(in CharSpan) | Appends a CharSpan to the current UnsafeStringBuilder. |
Append(UnsafeString) | Appends an UnsafeString to the current UnsafeStringBuilder. |
Append(UnsafeStringBuilder) | Appends the current value of a UnsafeStringBuilder to the current UnsafeStringBuilder. |
Append(Boolean) | Appends a Boolean ( |
Append(Byte) | Appends a Byte (with decimal formatting) to the current UnsafeStringBuilder. |
Append(Char) | Appends one |
Append(Char*, Int32) | Appends an unmanaged array of |
Append(Char, Char) | Appends two |
Append(Char, Char, Char) | Appends three |
Append(Char, Char, Char, Char) | Appends four |
Append(Char, Char, Char, Char, Char) | Appends five |
Append(Char, Int32) | Appends several times the same |
Append(Char[]) | Appends an array of |
Append(Char[], Int32, Int32) | Appends an array segment of |
Append(Int16) | Appends a Int16 (with decimal formatting) to the current UnsafeStringBuilder. |
Append(Int32) | Appends a Int32 (with decimal formatting) to the current UnsafeStringBuilder. |
Append(Int64) | Appends a Int64 (with decimal formatting) to the current UnsafeStringBuilder. |
Append(SByte) | Appends an SByte (with decimal formatting) to the current UnsafeStringBuilder. |
Append(String) | Appends a String to the current UnsafeStringBuilder. |
Append(String, Int32, Int32) | Appends a part of a String to the current UnsafeStringBuilder. |
Append(UInt16) | Appends a UInt16 (with decimal formatting) to the current UnsafeStringBuilder. |
Append(UInt32) | Appends a UInt32 (with decimal formatting) to the current UnsafeStringBuilder. |
Append(UInt64) | Appends a UInt64 (with decimal formatting) to the current UnsafeStringBuilder. |
Clear() | Clears the current UnsafeStringBuilder so it can be reused to build a new string. |
Dispose() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. |
SetNullTermination() | Appends a null character at the end of the current string, without affecting the string length.
In case of overflow, if ThrowOnOverflow is |
Substring(Int32) | Returns the substring starting at a given index and ending at the end of the current string. |
Substring(Int32, Int32) | Returns the substring starting at a given index and having a specified length. |
ToString() | Returns a string that represents the current object. |
ToUnsafeString() | Gets an UnsafeString that provides read-only access to the current UnsafeStringBuilder. |
Truncate(Int32) | Truncates the string to a maximum length. |