Git Product home page Git Product logo

Comments (2)

tannergooding avatar tannergooding commented on August 25, 2024

For 3.8.0, there are additional helper methods that take a CXUnsavedFile[] instead. For example: https://github.com/microsoft/ClangSharp/blob/b52de9c08f7243a8f060d511e1d9ed1a901d3cb3/ClangSharp/Generated.Custom.cs#L42

This has all been rewritten since then and there just hasn't been a new NuGet package published yet. Now, the original signature is correct and just takes a CXUnsavedFile*: https://github.com/microsoft/ClangSharp/blob/master/sources/ClangSharp/Interop/clang.cs#L218

There are then friendly helper functions such as CXTranslationUnit.Parse which don't require the consumer to use unsafe code: https://github.com/microsoft/ClangSharp/blob/master/sources/ClangSharp/Interop.Extensions/CXTranslationUnit.cs#L72

The recommended approach with the latest sources, if you are willing to build them locally, would be to create the CXTranslationUnit using the latter method and then call TranslationUnit.GetOrCreate to get a friendly/type-safe version: https://github.com/microsoft/ClangSharp/blob/master/sources/ClangSharp/TranslationUnit.cs#L39.

You can then use the TranslationUnit type for walking/handling most of the AST and falling back to the .Handle and direct methods where functionality isn't exposed.

from clangsharp.

tannergooding avatar tannergooding commented on August 25, 2024

A preview of the 8.0.0 bits are available on NuGet now, you should be able to use that to test the scenario I mentioned above.

from clangsharp.

Related Issues (20)

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.