Overview of CppSharp
mainCppSharp is a toolset and library designed to facilitate the use of native C/C++ code within the .NET ecosystem. It consumes C/C++ header and library files to generate managed API glue code. This allows developers to either consume existing native libraries in managed code or add managed scripting support to a native codebase.
Supported Target Languages:
- C#
- C++/CLI
Core Capabilities:
- AST: Provides C# APIs that mirror Clang's C/C++ AST and type system, including declarations, statements, expressions, types, object layouts, and visitors.
- Parser: Uses the Clang C++ parser to parse C/C++ source code, library archives, and shared library symbols into a syntax tree.
- Generator: Creates glue binding code from the syntax tree. It supports multiple backends (C++/CLI, C# P/Invoke), multiple ABIs (Itanium, MS, ARM, iOS), multiple platforms (Windows, OS X, Linux), and multiple runtimes (.NET, Mono). It handles complex C++ features like virtual method overriding, multiple inheritance (via C# interfaces),
std::string, and default parameter values.