UnsafeStringBuilder Class |
A class similar to StringBuilder, but implemented using unsafe C#.
Namespace: PostSharp.Patterns.Formatters
Assembly: PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
public sealed class UnsafeStringBuilder : IDisposable
The UnsafeStringBuilder type exposes the following members.
Name | Description | |
---|---|---|
UnsafeStringBuilder(Int32, Boolean) |
Initializes a new UnsafeStringBuilder and allocates a new buffer.
| |
UnsafeStringBuilder(Char*, Int32, Boolean) |
Initializes a new UnsafeStringBuilder with a pre-allocated buffer/
|
Name | Description | |
---|---|---|
Buffer |
Gets a pointer to the unmanaged buffer of the current UnsafeStringBuilder.
| |
Capacity |
Gets the capacity (number of char) of the current UnsafeStringBuilder.
| |
IsDisposed |
Determines whether the current UnsafeStringBuilder has been disposed.
| |
Item |
Gets the char at a given position in the current UnsafeStringBuilder.
| |
Length |
Gets the current number of characters in the current UnsafeStringBuilder.
| |
ThrowOnOverflow | true if an OverflowException should be thrown when
the buffer capacity is insufficient, false if the Append method should return false without exception.
| |
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.
|
Name | Description | |
---|---|---|
Append(Boolean) | ||
Append(Byte) |
Appends a Byte (with decimal formatting) to the current UnsafeStringBuilder.
| |
Append(Char) |
Appends one char to the current UnsafeStringBuilder.
| |
Append(Char[]) |
Appends an array of char to the current UnsafeStringBuilder.
| |
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(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.
| |
Append(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(Char*, Int32) |
Appends an unmanaged array of char to the current UnsafeStringBuilder.
| |
Append(Char, Char) |
Appends two char to the current UnsafeStringBuilder.
| |
Append(Char, Int32) |
Appends several times the same char to the current UnsafeStringBuilder.
| |
Append(Char, Char, Char) |
Appends three char to the current UnsafeStringBuilder.
| |
Append(Char[], Int32, Int32) |
Appends an array segment of char to the current UnsafeStringBuilder.
| |
Append(String, Int32, Int32) |
Appends a part of a String to the current UnsafeStringBuilder.
| |
Append(Char, Char, Char, Char) |
Appends four char to the current UnsafeStringBuilder.
| |
Append(Char, Char, Char, Char, Char) |
Appends five char 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. (Overrides Object.Finalize().) | |
SetNullTermination |
Appends a null character at the end of the current string, without affecting the string length.
In case of overflow, if ThrowOnOverflow is false, the last character of the string is removed
and the string length is decreased by 1.
| |
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. (Overrides Object.ToString().) | |
ToUnsafeString |
Gets an UnsafeString that provides read-only access to the current UnsafeStringBuilder.
| |
Truncate |
Truncates the string to a maximum length.
|