Coder Social home page Coder Social logo

wchart.net's Introduction

WCharT.Net

Build StatusNuGetLicense (MIT)

Welcome to WCharT.Net a modern cross platform package to interop with WCharT data.

Use

To work with WCharT data create a new instance of WCharTString:

//Read data from a byte*
byte* pointer = NativeCall();
var str = new WCharTString(pointer).GetString();

//Create a buffer for a native library and read the data after it was filled
ReadOnlySpan<byte> data = new WCharTString(int bufferCharSize);
NativeCall(...);
var str = data.GetString();

//Pass a string to a native library
ReadOnlySpan<byte> data = new WCharTString(string str);
NativeCall(data);

//Can be used in fixed statements
var data = new WCharTString(string str);
fixed (byte* ptr = data)
{
    NativeCall(ptr);
}

Build

To build the solution locally execute the following commands:

$ git clone https://github.com/badcel/WCharT.Net.git
$ cd WCharT.Net/src
$ dotnet fsi build.fsx

Native AOT

If the application targets at least .NET 8 the nuget package allows applications to be published as Native AOT as itself is AOT compatible.

Licensing terms

HidApi.Net is licensed under the terms of the MIT-License. Please see the license file for further information.

wchart.net's People

Contributors

badcel avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar

wchart.net's Issues

Improve internal structure

Create discrete classes per platform (Platform.Windows, Platform.Unix).

Select the class during build via a rename from the using statement to "Platform". There should only be one compile time constant "TARGET_WINDOWS" which gets checked.

Ensure that the trimmer removes the obsolete Platform during compilation.

In this way both files can be included, the csproj should be simplified, no class is greyed out.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.