// <auto-generated>
// This file is generated by Ghost.NativeWrapperGen. Do not edit manually.
// </auto-generated>

namespace Ghost.Ufbx;

public unsafe partial struct ufbx_stream
{
    /// <summary>
    /// From: <see cref="Api.ufbx_load_stream(ufbx_stream*, ufbx_load_opts*, ufbx_error*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public ufbx_scene* Load(ufbx_load_opts* opts, ufbx_error* error)
    {
        return Api.ufbx_load_stream(
            (ufbx_stream*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
            opts,
            error);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_load_stream_prefix(ufbx_stream*, void*, nuint, ufbx_load_opts*, ufbx_error*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public ufbx_scene* LoadPrefix(void* prefix, nuint prefix_size, ufbx_load_opts* opts, ufbx_error* error)
    {
        return Api.ufbx_load_stream_prefix(
            (ufbx_stream*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
            prefix,
            prefix_size,
            opts,
            error);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_open_file(ufbx_stream*, sbyte*, nuint, ufbx_open_file_opts*, ufbx_error*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public bool OpenFile(ReadOnlySpan<byte> path, ufbx_open_file_opts* opts, ufbx_error* error)
    {
        fixed (byte* ppath = path)
        {
            return Api.ufbx_open_file(
                (ufbx_stream*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
                (sbyte*)ppath,
                (nuint)path.Length,
                opts,
                error);
        }
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_open_file_ctx(ufbx_stream*, nuint, sbyte*, nuint, ufbx_open_file_opts*, ufbx_error*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public bool OpenFileCtx(nuint ctx, ReadOnlySpan<byte> path, ufbx_open_file_opts* opts, ufbx_error* error)
    {
        fixed (byte* ppath = path)
        {
            return Api.ufbx_open_file_ctx(
                (ufbx_stream*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
                ctx,
                (sbyte*)ppath,
                (nuint)path.Length,
                opts,
                error);
        }
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_open_memory(ufbx_stream*, void*, nuint, ufbx_open_memory_opts*, ufbx_error*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public bool OpenMemory(void* data, nuint data_size, ufbx_open_memory_opts* opts, ufbx_error* error)
    {
        return Api.ufbx_open_memory(
            (ufbx_stream*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
            data,
            data_size,
            opts,
            error);
    }

    /// <summary>
    /// From: <see cref="Api.ufbx_open_memory_ctx(ufbx_stream*, nuint, void*, nuint, ufbx_open_memory_opts*, ufbx_error*)" />
    /// </summary>
    [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
    public bool OpenMemoryCtx(nuint ctx, void* data, nuint data_size, ufbx_open_memory_opts* opts, ufbx_error* error)
    {
        return Api.ufbx_open_memory_ctx(
            (ufbx_stream*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
            ctx,
            data,
            data_size,
            opts,
            error);
    }
}
