Comments (2)
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.
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)
- Incorrect enum base type
- More verbose "Log Exclusions" Option?
- The generated .cs file doesn't work (Unhandled exception. System.EntryPointNotFoundException) HOT 5
- AccessViolationException in ClangSharp.CXXMethodDecl.VtblIndex (ClangSharp.Interop.clangsharp.Cursor_getVtblIdx) HOT 1
- How to use wildcard in `--with-using`?
- Newby Question: Could I use your project to build a C# interface for https://github.com/infiniflow HOT 1
- Support generating equality operators or IEquattable<T> implementation in C# via ClangSharpPInvokeGenerator HOT 2
- Unable to find package libClangSharp.runtime.linux-arm64 with version (>= 17.0.4) HOT 1
- System.UnauthorizedAccessException: Access to the path is denied HOT 2
- How to include a system header required by the file to parse HOT 2
- Standardization of XML Output HOT 1
- Built Native failed HOT 3
- Latest 18.1.0 release breaks type remapping for args with spaces in them HOT 2
- Passing `generate-file-scoped-namespaces` results in extra curly brace being added to end of file HOT 3
- Parsing ESPMode::ThreadSafe as Template Argument in Version 18.0.1
- Structure field type remapping
- UnqualifiedDesugaredType does not return an unqualified type HOT 2
- Behavior of --with-attribute has changed? HOT 2
- How to handle types defined outside header without include HOT 1
- How to generate comments using PInvokeGenerator
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clangsharp.