mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 06:13:40 +01:00
Make manual overloads for string-returning functinos
This commit is contained in:
parent
334a02e69a
commit
4b1857e40d
12 changed files with 239 additions and 462 deletions
|
|
@ -1,7 +1,14 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Dalamud.Bindings.ImGui;
|
||||
|
||||
public unsafe partial struct ImGuiTextBuffer
|
||||
{
|
||||
public readonly Span<byte> Span => new(this.Buf.Data, this.Buf.Size);
|
||||
|
||||
public override readonly string ToString() => Encoding.UTF8.GetString(this.Span);
|
||||
|
||||
public void append(ImU8String str)
|
||||
{
|
||||
fixed (ImGuiTextBuffer* thisPtr = &this)
|
||||
|
|
@ -9,7 +16,11 @@ public unsafe partial struct ImGuiTextBuffer
|
|||
}
|
||||
}
|
||||
|
||||
public partial struct ImGuiTextBufferPtr
|
||||
public unsafe partial struct ImGuiTextBufferPtr
|
||||
{
|
||||
public readonly Span<byte> Span => new(Unsafe.AsRef(in this).Buf.Data, Unsafe.AsRef(in this).Buf.Size);
|
||||
|
||||
public override readonly string ToString() => Encoding.UTF8.GetString(this.Span);
|
||||
|
||||
public void append(ImU8String str) => ImGui.append(this, str);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue