mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
chore: Convert AsLuminaSeString to AsReadOnlySeString
- Somewhat more useful, or so one would hope.
This commit is contained in:
parent
a7509ef77d
commit
27dc659561
1 changed files with 8 additions and 7 deletions
|
|
@ -35,16 +35,17 @@ public static class CStringExtensions
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a new SeString that's a <em>copy</em> of the text in this CStringPointer.
|
||||
/// Get a new ReadOnlySeString that's a <em>copy</em> of the text in this CStringPointer.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This should be functionally identical to <see cref="AsReadOnlySeStringSpan"/>, but exists
|
||||
/// for convenience in places that already expect ReadOnlySeString as a type (and where a copy is desired).
|
||||
/// </remarks>
|
||||
/// <param name="ptr">The pointer to copy.</param>
|
||||
/// <returns>A new Lumina SeString.</returns>
|
||||
public static Lumina.Text.SeString AsLuminaSeString(this CStringPointer ptr)
|
||||
/// <returns>A new Lumina ReadOnlySeString.</returns>
|
||||
public static ReadOnlySeString AsReadOnlySeString(this CStringPointer ptr)
|
||||
{
|
||||
var ssb = new Lumina.Text.SeStringBuilder();
|
||||
ssb.Append(ptr.AsSpan());
|
||||
|
||||
return ssb.ToSeString();
|
||||
return new ReadOnlySeString(ptr.AsSpan().ToArray());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue