DeafMan1983.Conversion 3.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DeafMan1983.Conversion --version 3.0.0                
NuGet\Install-Package DeafMan1983.Conversion -Version 3.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DeafMan1983.Conversion" Version="3.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DeafMan1983.Conversion --version 3.0.0                
#r "nuget: DeafMan1983.Conversion, 3.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DeafMan1983.Conversion as a Cake Addin
#addin nuget:?package=DeafMan1983.Conversion&version=3.0.0

// Install DeafMan1983.Conversion as a Cake Tool
#tool nuget:?package=DeafMan1983.Conversion&version=3.0.0                

ConversionFunctions

Conversion functions for sbyte * and string hacks!

Changvs and fixes: Fixed: SByteDoublePointersWithStringArray, thanks Jester @QubitTooLate


Replaced: StringFromCharPtr to SBytePointerWithStringForAdvanced StringFromHeap to SBytePointerWithString CharPtrToString to StringwithSBytePointer Added: new functions for sbyte ** and string[] SByteDoublePointersWithStringArray ( Fixed and add NativeMemory, Thanks Jan Kotas!!! ) StringArrayWithSByteDoublePointers Update: to 3.0.0

How does it work? If you use sbyte* for string like example in X11's XOpenDisplay() or SDL_SetWindowTitle()

For X11 from TerraFX.Interop.Xlib

....
Display *display = XOpenDisplay(SBytePointerWithString(string.Empty));
....

Or for SDL3 from DeafMan1983.Interop.SDL3

....
SDL_SetWindows(window, SBytePointerWithString("Hello SDL3 Window"));
....

For string for sbyte * like example X11's XDisplayString() or SDL3's SDL_GetWindowTitle()

....
string d_str = StringWithSBytePointer(XDisplayString(display));
....

or SDL3

....
string title_str = StringWithSBytePointer(SDL_GetWindowTitle(window));
....

And new more functions:

For string[] for sbyte ** like you use delegate *unmanaged[Cdecl]<sbyte **, int, void> or delegate *unmanaged[Cdecl]<sbyte **, int, int> and It works for Game, Application they can load external native library but I have tested with Console.WriteLine() It is successfully. But I never did other like Winfows.Forms or Xlib, SDL3 I will see how does it work for external native libraries.

....
string[] args = StringArrayWithSByteDoublePointers(sArrays, array_length);
....

Warning It is important for [UnmanagedCallerOnly] and it uses sbyte ** and int for array_length If you pass string[] args from Program.cs then you need add SByteDoublePointersWithStringArray

Example:

sbyte **sArrays = SByteDoublePointersWithStringArray(args);
pfnMainFunc(sArrays, args.length);
....

And I have updated already in Nuget.org

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.0 218 5/28/2023 4.0.0 is deprecated.
3.0.0 159 5/12/2023
2.0.0 160 5/4/2023
1.0.0 183 4/24/2023