Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String marshalling fix #3

Merged
merged 8 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Speykious
// Copyright (c) Speykious
// This file is part of NativeFileDialogs.NET.
// NativeFileDialogs.NET is licensed under the Zlib License. See LICENSE for details.

Expand All @@ -9,22 +9,22 @@
{
nfd.NFD_Init();

NfdnfilteritemT[] filterItem = new[]
Nfdu8filteritemT[] filterItem = new[]
{
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Source code",
Spec = "c,cpp,cc",
},
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Headers",
Spec = "h,hpp",
},
};

sbyte* outPathPtr;
NfdresultT result = nfd.NFD_OpenDialogN(&outPathPtr, filterItem, (uint)filterItem.Length, null);
NfdresultT result = nfd.NFD_OpenDialogU8(&outPathPtr, filterItem, (uint)filterItem.Length, null);
switch (result)
{
case NfdresultT.NFD_OKAY:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Speykious
// Copyright (c) Speykious
// This file is part of NativeFileDialogs.NET.
// NativeFileDialogs.NET is licensed under the Zlib License. See LICENSE for details.

Expand All @@ -9,22 +9,22 @@
{
nfd.NFD_Init();

NfdnfilteritemT[] filterItems = new[]
Nfdu8filteritemT[] filterItems = new[]
{
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Source code",
Spec = "c,cpp,cc",
},
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Headers",
Spec = "h,hpp",
},
};

IntPtr pathSet;
NfdresultT result = nfd.NFD_OpenDialogMultipleN(&pathSet, filterItems, (uint)filterItems.Length, null);
NfdresultT result = nfd.NFD_OpenDialogMultipleU8(&pathSet, filterItems, (uint)filterItems.Length, null);
switch (result)
{
case NfdresultT.NFD_OKAY:
Expand All @@ -36,7 +36,7 @@
for (uint i = 0; i < count; i++)
{
sbyte* pathPtr;
nfd.NFD_PathSetGetPathN(pathSet, i, &pathPtr);
nfd.NFD_PathSetGetPathU8(pathSet, i, &pathPtr);
outPaths[i] = new string(pathPtr);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Speykious
// Copyright (c) Speykious
// This file is part of NativeFileDialogs.NET.
// NativeFileDialogs.NET is licensed under the Zlib License. See LICENSE for details.

Expand All @@ -10,7 +10,7 @@
nfd.NFD_Init();

sbyte* outPathPtr;
NfdresultT result = nfd.NFD_PickFolderN(&outPathPtr, null);
NfdresultT result = nfd.NFD_PickFolderU8(&outPathPtr, null);
switch (result)
{
case NfdresultT.NFD_OKAY:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Speykious
// Copyright (c) Speykious
// This file is part of NativeFileDialogs.NET.
// NativeFileDialogs.NET is licensed under the Zlib License. See LICENSE for details.

Expand All @@ -9,22 +9,22 @@
{
nfd.NFD_Init();

NfdnfilteritemT[] filterItem = new[]
Nfdu8filteritemT[] filterItem = new[]
{
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Source code",
Spec = "c,cpp,cc",
},
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Headers",
Spec = "h,hpp",
},
};

sbyte* savePathPtr;
NfdresultT result = nfd.NFD_SaveDialogN(&savePathPtr, filterItem, (uint)filterItem.Length, null, "Untitled.c");
NfdresultT result = nfd.NFD_SaveDialogU8(&savePathPtr, filterItem, (uint)filterItem.Length, null, "Untitled.c");
switch (result)
{
case NfdresultT.NFD_OKAY:
Expand Down
11 changes: 6 additions & 5 deletions NativeFileDialogs.AutoGen/NativeFileDialogs.AutoGen-symbols.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <nfd.h>
#include <new>

nfdpathsetenum_t& (nfdpathsetenum_t::*_0)(nfdpathsetenum_t&&) = &nfdpathsetenum_t::operator=;
nfdnfilteritem_t& (nfdnfilteritem_t::*_1)(nfdnfilteritem_t&&) = &nfdnfilteritem_t::operator=;
#include <nfd.h>
#include <new>

nfdpathsetenum_t& (nfdpathsetenum_t::*_0)(nfdpathsetenum_t&&) = &nfdpathsetenum_t::operator=;
nfdnfilteritem_t& (nfdnfilteritem_t::*_1)(nfdnfilteritem_t&&) = &nfdnfilteritem_t::operator=;
nfdu8filteritem_t& (nfdu8filteritem_t::*_2)(nfdu8filteritem_t&&) = &nfdu8filteritem_t::operator=;
4 changes: 2 additions & 2 deletions NativeFileDialogs.AutoGen/NativeFileDialogs.AutoGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</PropertyGroup>

<ItemGroup Label="Package References">
<PackageReference Include="CppSharp.Runtime" Version="1.0.3" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="CppSharp.Runtime" Version="1.1.5.3168" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
30 changes: 16 additions & 14 deletions NativeFileDialogs.AutoGen/Std.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// ----------------------------------------------------------------------------
// <auto-generated>
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
// </auto-generated>
// ----------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using __CallingConvention = global::System.Runtime.InteropServices.CallingConvention;
using __IntPtr = global::System.IntPtr;
[assembly:InternalsVisibleTo("nfd")]

// ----------------------------------------------------------------------------
// <auto-generated>
// This is autogenerated code by CppSharp.
// Do not edit this file or all your changes will be lost after re-generation.
// </auto-generated>
// ----------------------------------------------------------------------------
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using __CallingConvention = global::System.Runtime.InteropServices.CallingConvention;
using __IntPtr = global::System.IntPtr;
[assembly:InternalsVisibleTo("nfd")]

#pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required

Loading