mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 13:14:17 +01:00
Add SeString.Parse(byte*) (#1937)
This commit is contained in:
parent
f7f52ddc77
commit
378ef0a052
1 changed files with 8 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
|
|
@ -162,6 +163,13 @@ public class SeString
|
||||||
/// <returns>An SeString containing parsed Payload objects for each payload in the data.</returns>
|
/// <returns>An SeString containing parsed Payload objects for each payload in the data.</returns>
|
||||||
public static SeString Parse(byte[] bytes) => Parse(new ReadOnlySpan<byte>(bytes));
|
public static SeString Parse(byte[] bytes) => Parse(new ReadOnlySpan<byte>(bytes));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parse a binary game message into an SeString.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ptr">Pointer to the string's data in memory. Needs to be null-terminated.</param>
|
||||||
|
/// <returns>An SeString containing parsed Payload objects for each payload in the data.</returns>
|
||||||
|
public static unsafe SeString Parse(byte* ptr) => Parse(MemoryMarshal.CreateReadOnlySpanFromNullTerminated(ptr));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an SeString representing an entire Payload chain that can be used to link an item in the chat log.
|
/// Creates an SeString representing an entire Payload chain that can be used to link an item in the chat log.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue