diff --git a/.github/workflows/llvm-win.yml b/.github/workflows/llvm-win.yml index 43b9891fba..210579e244 100644 --- a/.github/workflows/llvm-win.yml +++ b/.github/workflows/llvm-win.yml @@ -9,8 +9,8 @@ jobs: fail-fast: false matrix: config: - - { os: windows-2022, platform: x86, vs: "Program Files/Microsoft Visual Studio/2022" } - - { os: windows-2022, platform: x64, vs: "Program Files/Microsoft Visual Studio/2022" } + - { os: windows-2022, platform: x64, configuration : Debug, vs: "Program Files/Microsoft Visual Studio/2022" } + - { os: windows-2022, platform: x64, configuration : RelWithDebInfo, vs: "Program Files/Microsoft Visual Studio/2022" } runs-on: ${{ matrix.config.os }} @@ -19,6 +19,7 @@ jobs: CXX: ${{ matrix.config.cxx }} VS_VERSION: ${{ matrix.config.vs }} PLATFORM: ${{ matrix.config.platform }} + CONFIGURATION: ${{ matrix.config.configuration }} ACTIONS_ALLOW_UNSECURE_COMMANDS: true steps: @@ -51,16 +52,16 @@ jobs: - name: Build LLVM shell: bash - run: build/build.sh build_llvm -platform $PLATFORM + run: build/build.sh build_llvm -platform $PLATFORM -configuration $CONFIGURATION working-directory: C:\CppSharp - name: Package LLVM shell: bash - run: build/build.sh package_llvm -platform $PLATFORM + run: build/build.sh package_llvm -platform $PLATFORM -configuration $CONFIGURATION working-directory: C:\CppSharp - name: 'Upload Artifact' uses: actions/upload-artifact@v3 with: name: llvm - path: C:\CppSharp\build\llvm\llvm-*-*.* \ No newline at end of file + path: C:\CppSharp\build\llvm\llvm-*-*.* diff --git a/.github/workflows/llvm.yml b/.github/workflows/llvm.yml index d8b3f10b82..966cc16922 100644 --- a/.github/workflows/llvm.yml +++ b/.github/workflows/llvm.yml @@ -10,8 +10,10 @@ jobs: matrix: config: - { os: ubuntu-22.04, platform: x64, cxx: g++-11, cc: gcc-11 } + - { os: ubuntu-22.04, platform: arm64, cxx: g++-11, cc: gcc-11 } - { os: macos-11, platform: x64, cxx: clang++, cc: clang } - { os: macos-12, platform: x64, cxx: clang++, cc: clang } + - { os: macos-12, platform: arm64, cxx: clang++, cc: clang } runs-on: ${{ matrix.config.os }} @@ -22,9 +24,13 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest + - name: Install cross compilers + if: startsWith(matrix.config.os, 'ubuntu') && startsWith(matrix.config.platform, 'arm64') + run: sudo apt install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu + - name: Clone LLVM shell: bash run: build/build.sh clone_llvm @@ -41,4 +47,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: llvm - path: build/llvm/llvm-*-*.* \ No newline at end of file + path: build/llvm/llvm-*-*.* diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d26b7adcb0..17079e73d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: DOTNET_CLI_TELEMETRY_OPTOUT: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: '0' @@ -63,7 +63,7 @@ jobs: shell: bash run: build/build.sh prepack -platform $PLATFORM - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: intermediate path: | @@ -82,14 +82,14 @@ jobs: DOTNET_CLI_TELEMETRY_OPTOUT: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: '0' - name: Set version run: nbgv cloud --all-vars - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: intermediate @@ -102,7 +102,7 @@ jobs: run: build/build.sh pack - name: Upload package - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: CppSharp.nupkg path: | diff --git a/Directory.Build.props b/Directory.Build.props index e6c25f85f5..0dc6c392cf 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,57 +1,58 @@ - - - - - $(MSBuildThisFileDirectory) - x86;x64 - false - true - MIT - https://github.com/mono/CppSharp - $(GITHUB_SHA) - João Matos, Dimitar Dobrev, Jose Torres - João Matos, Dimitar Dobrev - $(NBGV_Version) - $(NBGV_AssemblyVersion) - $(NBGV_AssemblyFileVersion) - $(NBGV_AssemblyInformationalVersion) - false - $(RootDir)build\ - $(BuildDir)obj\ - $(BuildDir)gen\ - $(RootDir)src\ - $(TargetFramework) - $(ObjDir)$(MSBuildProjectName)\ - $(RootDir)bin\ - $(BaseOutputPath)$(Configuration)_$(PlatformTarget)\ - $(BuildDir)$(PremakeAction)\ - $(ActionDir)projects\ - $(RootDir)artifacts\package\ - $(OutputPath) - 9.0 - 4 - dotnet - dll - "$(MSBuildProgramFiles32)\dotnet\dotnet.exe" - "$(ProgramW6432)\dotnet\dotnet.exe" - win - linux - osx - $(RID)-$(PlatformTarget) - - - - true - full - false - - - - exe - - - - - - + + + + + $(MSBuildThisFileDirectory) + x86;x64 + false + true + MIT + https://github.com/mono/CppSharp + $(GITHUB_SHA) + João Matos, Dimitar Dobrev, Jose Torres + João Matos, Dimitar Dobrev + $(NBGV_Version) + $(NBGV_AssemblyVersion) + $(NBGV_AssemblyFileVersion) + $(NBGV_AssemblyInformationalVersion) + false + $(RootDir)build\ + $(BuildDir)obj\ + $(BuildDir)gen\ + $(RootDir)src\ + $(TargetFramework) + $(ObjDir)$(MSBuildProjectName)\ + $(RootDir)bin\ + $(BaseOutputPath)$(Configuration)_$(PlatformTarget)\ + $(BuildDir)$(PremakeAction)\ + $(ActionDir)projects\ + $(RootDir)artifacts\package\ + $(OutputPath) + 10.0 + 4 + dotnet + dll + "$(MSBuildProgramFiles32)\dotnet\dotnet.exe" + "$(ProgramW6432)\dotnet\dotnet.exe" + win + linux + osx + $(RID)-$(PlatformTarget) + + + + true + full + false + + + + exe + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 4bf008a259..8c013d3260 100644 --- a/README.md +++ b/README.md @@ -74,12 +74,11 @@ Please see the following resources for more information: ## Community -Feel free to open up issues on Github for any problems you find. +Feel free to open up issues on GitHub for any problems you find. ## Support -For building wrappers and priority support please write to cppsharp@protonmail.com. -Alternatively, you may post bounties at https://www.bountysource.com/. +If you need commercial support feel free to open a discussion or issue for discussion. ## Users @@ -109,4 +108,6 @@ CppSharp is used by the following projects: [GLFW3.NET](https://github.com/realvictorprm/GLFW3.NET) +[DearImguiSharp](https://github.com/Sewer56/DearImguiSharp) + Please feel free to send us a pull request adding your own projects to the list above. diff --git a/build/Helpers.lua b/build/Helpers.lua index 0a2e030d1c..96a3235472 100644 --- a/build/Helpers.lua +++ b/build/Helpers.lua @@ -10,6 +10,7 @@ newoption { allowed = { { "x86", "x86 32-bits" }, { "x64", "x64 64-bits" }, + { "arm64","ARM64 64-bits" }, } } @@ -251,11 +252,15 @@ function AddPlatformSpecificFiles(folder, filename) filter { "toolset:msc*", "architecture:x86" } files { path.join(folder, "i686-pc-win32-msvc", filename) } elseif os.istarget("macosx") then + filter { "architecture:arm64" } + files { path.join(folder, "arm64-apple-darwin12.4.0", filename) } filter { "architecture:x86_64" } files { path.join(folder, "x86_64-apple-darwin12.4.0", filename) } filter {"architecture:x86" } files { path.join(folder, "i686-apple-darwin12.4.0", filename) } elseif os.istarget("linux") then + filter { "architecture:arm64" } + files { path.join(folder, "arm64-linux-gnu" .. (UseCxx11ABI() and "-cxx11abi" or ""), filename) } filter { "architecture:x86_64" } files { path.join(folder, "x86_64-linux-gnu" .. (UseCxx11ABI() and "-cxx11abi" or ""), filename) } else diff --git a/build/LLVM.lua b/build/LLVM.lua index 86fa1be6b3..9ac89c54c0 100644 --- a/build/LLVM.lua +++ b/build/LLVM.lua @@ -172,6 +172,12 @@ function SetupLLVMLibs() "LLVMX86CodeGen", "LLVMX86Desc", "LLVMX86Info", + "LLVMAArch64AsmParser", + "LLVMAArch64CodeGen", + "LLVMAArch64Desc", + "LLVMAArch64Disassembler", + "LLVMAArch64Info", + "LLVMAArch64Utils", "LLVMipo", "LLVMInstrumentation", "LLVMVectorize", diff --git a/build/llvm/LLVM.lua b/build/llvm/LLVM.lua index f375b39e92..0a08c06191 100644 --- a/build/llvm/LLVM.lua +++ b/build/llvm/LLVM.lua @@ -254,7 +254,7 @@ function cmake(gen, conf, builddir, options) .. ' -DLLVM_ENABLE_ZSTD=false' .. ' -DLLVM_INCLUDE_DOCS=false' .. ' -DLLVM_INCLUDE_EXAMPLES=false' - .. ' -DLLVM_TARGETS_TO_BUILD="X86"' + .. ' -DLLVM_TARGETS_TO_BUILD="X86;AArch64"' .. ' -DLLVM_TOOL_BUGPOINT_BUILD=false' .. ' -DLLVM_TOOL_BUGPOINT_PASSES_BUILD=false' .. ' -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=false' @@ -438,10 +438,44 @@ function build_llvm(llvm_build) local options = os.ishost("macosx") and "-DLLVM_ENABLE_LIBCXX=true" or "" local is32bits = target_architecture() == "x86" + local targetIsArm64 = target_architecture() == "arm64" + if is32bits then options = options .. (is32bits and " -DLLVM_BUILD_32_BITS=true" or "") end + if targetIsArm64 then + if os.host() == "linux" then + local host_arch = unix_host_architecture() + if host_arch ~= "aarch64" then + options = options .. "" + .. ' -DCMAKE_SYSTEM_NAME=Linux' + .. ' -DCMAKE_SYSTEM_PROCESSOR=aarch64' + .. ' -DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc' + .. ' -DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++' + .. ' -DCMAKE_ASM_COMPILER=/usr/bin/aarch64-linux-gnu-as' + .. ' -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER' + .. ' -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY' + .. ' -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY' + .. ' -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY' + .. ' ' .. options + end + end + if os.host() == "macosx" then + local host_arch = unix_host_architecture() + if host_arch ~= "arm64" then + options = options .. "" + .. ' -DCMAKE_SYSTEM_NAME=Darwin' + .. ' -DCMAKE_SYSTEM_PROCESSOR=arm64' + .. ' -DCMAKE_C_COMPILER_TARGET=arm64-apple-darwin21.6.0' + .. ' -DCMAKE_CXX_COMPILER_TARGET=arm64-apple-darwin21.6.0' + .. ' -DCMAKE_ASM_COMPILER_TARGET=arm64-apple-darwin21.6.0' + .. ' ' .. options + end + end + end + + cmake("Ninja", conf, llvm_build, options) ninja('"' .. llvm_build .. '"') ninja('"' .. llvm_build .. '"', "clang-headers") diff --git a/build/scripts/Utils.lua b/build/scripts/Utils.lua index afccb4e731..0ec325cafd 100644 --- a/build/scripts/Utils.lua +++ b/build/scripts/Utils.lua @@ -112,6 +112,11 @@ function download(url, file, try) return res, code end +function unix_host_architecture() + result, errorCode = os.outputof("uname -m") + return result +end + -- -- Allows copying directories. -- It uses the premake patterns (**=recursive match, *=file match) @@ -202,4 +207,4 @@ function os.rmfiles(src_dir, filter) print( "Error: " .. counter .. "/" .. #matches .. " files removed.") return nil end -end \ No newline at end of file +end diff --git a/docs/LLVM.md b/docs/LLVM.md index 4a3d625afe..bbeaec6c67 100644 --- a/docs/LLVM.md +++ b/docs/LLVM.md @@ -54,9 +54,7 @@ Make sure to use the revisions specified below, or you will most likely get comp Required LLVM/Clang commits: -[LLVM: see /build/llvm/LLVM-commit.](https://github.com/mono/CppSharp/tree/master/build/LLVM-commit) - -[Clang: see /build/Clang-commit.](https://github.com/mono/CppSharp/tree/master/build/Clang-commit) +[LLVM: see /build/llvm/LLVM-commit.](https://github.com/mono/CppSharp/tree/master/build/llvm/LLVM-commit) To change to the revisions specified above you can run the following commands: diff --git a/examples/SDL/SDL.cs b/examples/SDL/SDL.cs index 040673db23..8ab9fd0b97 100644 --- a/examples/SDL/SDL.cs +++ b/examples/SDL/SDL.cs @@ -53,6 +53,8 @@ public void Preprocess(Driver driver, ASTContext ctx) ctx.IgnoreEnumWithMatchingItem("SDL_ENOMEM"); ctx.IgnoreFunctionWithName("SDL_Error"); + + ctx.SetFunctionParameterUsage("SDL_PollEvent", 1, ParameterUsage.Out); } public void Postprocess(Driver driver, ASTContext ctx) diff --git a/src/AST/ASTContext.cs b/src/AST/ASTContext.cs index 827ce261f4..e52107e0d0 100644 --- a/src/AST/ASTContext.cs +++ b/src/AST/ASTContext.cs @@ -10,8 +10,9 @@ public enum CppAbi Itanium, Microsoft, ARM, + AArch64, iOS, - iOS64, + AppleARM64, WebAssembly } diff --git a/src/AST/Template.cs b/src/AST/Template.cs index e71ee5b815..57cd5c7dce 100644 --- a/src/AST/Template.cs +++ b/src/AST/Template.cs @@ -304,6 +304,12 @@ public override string ToString() /// public class ClassTemplatePartialSpecialization : ClassTemplateSpecialization { + public readonly List Parameters; + + public ClassTemplatePartialSpecialization() + { + Parameters = new List(); + } } /// diff --git a/src/AST/TypeExtensions.cs b/src/AST/TypeExtensions.cs index 32333d6e6b..d94551cf71 100644 --- a/src/AST/TypeExtensions.cs +++ b/src/AST/TypeExtensions.cs @@ -439,6 +439,17 @@ public static bool IsDependentPointer(this Type type) return false; } + public static bool IsTemplateParameterType(this Type type) + { + if (type is TemplateParameterType or TemplateParameterSubstitutionType) + return true; + + if (type is PointerType pt) + return pt.GetFinalPointee() is TemplateParameterType or TemplateParameterSubstitutionType; + + return false; + } + public static Module GetModule(this Type type) { Declaration declaration; diff --git a/src/CLI/CLI.cs b/src/CLI/CLI.cs index 44889307cb..7b8068a4f9 100644 --- a/src/CLI/CLI.cs +++ b/src/CLI/CLI.cs @@ -206,33 +206,13 @@ static void GetFilesFromPath(string path, List errorMessages) static void GetGeneratorKind(string generator, List errorMessages) { - switch (generator.ToLower()) + foreach (GeneratorKind generatorKind in GeneratorKind.Registered) { - case "csharp": - options.Kind = GeneratorKind.CSharp; - return; - case "cli": - options.Kind = GeneratorKind.CLI; - return; - case "c": - options.Kind = GeneratorKind.C; - return; - case "cpp": - options.Kind = GeneratorKind.CPlusPlus; - return; - case "napi": - options.Kind = GeneratorKind.NAPI; - return; - case "qjs": - options.Kind = GeneratorKind.QuickJS; - return; - case "ts": - case "typescript": - options.Kind = GeneratorKind.TypeScript; - return; - case "emscripten": - options.Kind = GeneratorKind.Emscripten; + if (generatorKind.IsCLIOptionMatch(generator.ToLower())) + { + options.Kind = generatorKind; return; + } } errorMessages.Add($"Unknown generator kind: {generator}."); diff --git a/src/CLI/Generator.cs b/src/CLI/Generator.cs index 58db9ac72d..e7ac5d59f2 100644 --- a/src/CLI/Generator.cs +++ b/src/CLI/Generator.cs @@ -198,7 +198,7 @@ public void Postprocess(Driver driver, ASTContext ctx) public void Run() { var messageBuilder = new StringBuilder(); - messageBuilder.Append($"Generating {GetGeneratorKindName(options.Kind)}"); + messageBuilder.Append($"Generating {options.Kind.Name}"); messageBuilder.Append($" bindings for {GetPlatformName(options.Platform)} {options.Architecture}"); if (options.Cpp11ABI) @@ -225,20 +225,5 @@ private static string GetPlatformName(TargetPlatform? platform) return platform.ToString(); } } - - private static string GetGeneratorKindName(GeneratorKind kind) - { - switch (kind) - { - case GeneratorKind.CLI: - return "C++/CLI"; - case GeneratorKind.CSharp: - return "C#"; - case GeneratorKind.NAPI: - return "N-API"; - default: - return kind.ToString(); - } - } } } diff --git a/src/CppParser/AST.cpp b/src/CppParser/AST.cpp index b01cb8debd..1b33cdb8ce 100644 --- a/src/CppParser/AST.cpp +++ b/src/CppParser/AST.cpp @@ -793,6 +793,8 @@ ClassTemplatePartialSpecialization::ClassTemplatePartialSpecialization() ClassTemplatePartialSpecialization::~ClassTemplatePartialSpecialization() {} +DEF_VECTOR(ClassTemplatePartialSpecialization, Declaration*, Parameters) + FunctionTemplate::FunctionTemplate() : Template(DeclarationKind::FunctionTemplate) {} FunctionTemplate::~FunctionTemplate() {} diff --git a/src/CppParser/Bindings/CLI/Decl.cpp b/src/CppParser/Bindings/CLI/Decl.cpp index 6afab65ea7..58553e540a 100644 --- a/src/CppParser/Bindings/CLI/Decl.cpp +++ b/src/CppParser/Bindings/CLI/Decl.cpp @@ -4514,6 +4514,26 @@ CppSharp::Parser::AST::ClassTemplatePartialSpecialization::ClassTemplatePartialS NativePtr = new class ::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization(); } +CppSharp::Parser::AST::Declaration^ CppSharp::Parser::AST::ClassTemplatePartialSpecialization::GetParameters(unsigned int i) +{ + auto ___ret = ((class ::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization*)NativePtr)->getParameters(i); + if (___ret == nullptr) return nullptr; + return (___ret == nullptr) ? nullptr : gcnew ::CppSharp::Parser::AST::Declaration((class ::CppSharp::CppParser::AST::Declaration*)___ret); +} + +void CppSharp::Parser::AST::ClassTemplatePartialSpecialization::AddParameters(CppSharp::Parser::AST::Declaration^ s) +{ + if (ReferenceEquals(s, nullptr)) + throw gcnew ::System::ArgumentNullException("s", "Cannot be null because it is a C++ reference (&)."); + auto __arg0 = (class ::CppSharp::CppParser::AST::Declaration*)s->NativePtr; + ((class ::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization*)NativePtr)->addParameters(__arg0); +} + +void CppSharp::Parser::AST::ClassTemplatePartialSpecialization::ClearParameters() +{ + ((class ::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization*)NativePtr)->clearParameters(); +} + CppSharp::Parser::AST::ClassTemplatePartialSpecialization::ClassTemplatePartialSpecialization(CppSharp::Parser::AST::ClassTemplatePartialSpecialization^ _0) : CppSharp::Parser::AST::ClassTemplateSpecialization((::CppSharp::CppParser::AST::ClassTemplateSpecialization*)nullptr) { @@ -4524,6 +4544,35 @@ CppSharp::Parser::AST::ClassTemplatePartialSpecialization::ClassTemplatePartialS NativePtr = new class ::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization(__arg0); } +::System::Collections::Generic::List^ CppSharp::Parser::AST::ClassTemplatePartialSpecialization::Parameters::get() +{ + auto _tmp__Parameters = gcnew ::System::Collections::Generic::List(); + auto __list0 = ((class ::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization*)NativePtr)->Parameters; + for(auto _element : __list0) + { + auto _marshalElement = (_element == nullptr) ? nullptr : gcnew ::CppSharp::Parser::AST::Declaration((class ::CppSharp::CppParser::AST::Declaration*)_element); + _tmp__Parameters->Add(_marshalElement); + } + return _tmp__Parameters; +} + +void CppSharp::Parser::AST::ClassTemplatePartialSpecialization::Parameters::set(::System::Collections::Generic::List^ value) +{ + auto _tmpvalue = std::vector<::CppSharp::CppParser::AST::Declaration*>(); + for each(CppSharp::Parser::AST::Declaration^ _element in value) + { + auto _marshalElement = (class ::CppSharp::CppParser::AST::Declaration*)_element->NativePtr; + _tmpvalue.push_back(_marshalElement); + } + ((class ::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization*)NativePtr)->Parameters = _tmpvalue; +} + +unsigned int CppSharp::Parser::AST::ClassTemplatePartialSpecialization::ParametersCount::get() +{ + auto ___ret = ((class ::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization*)NativePtr)->getParametersCount(); + return ___ret; +} + CppSharp::Parser::AST::FunctionTemplate::FunctionTemplate(class ::CppSharp::CppParser::AST::FunctionTemplate* native) : CppSharp::Parser::AST::Template((::CppSharp::CppParser::AST::Template*)native) { diff --git a/src/CppParser/Bindings/CLI/Decl.h b/src/CppParser/Bindings/CLI/Decl.h index cfc54e8565..940ad9694a 100644 --- a/src/CppParser/Bindings/CLI/Decl.h +++ b/src/CppParser/Bindings/CLI/Decl.h @@ -255,9 +255,10 @@ namespace CppSharp Itanium = 0, Microsoft = 1, ARM = 2, - iOS = 3, - iOS64 = 4, - WebAssembly = 5 + AArch64 = 3, + iOS = 4, + AppleARM64 = 5, + WebAssembly = 6 }; public enum class RecordArgABI @@ -2205,6 +2206,23 @@ namespace CppSharp ClassTemplatePartialSpecialization(CppSharp::Parser::AST::ClassTemplatePartialSpecialization^ _0); ~ClassTemplatePartialSpecialization(); + + property ::System::Collections::Generic::List^ Parameters + { + ::System::Collections::Generic::List^ get(); + void set(::System::Collections::Generic::List^); + } + + property unsigned int ParametersCount + { + unsigned int get(); + } + + CppSharp::Parser::AST::Declaration^ GetParameters(unsigned int i); + + void AddParameters(CppSharp::Parser::AST::Declaration^ s); + + void ClearParameters(); }; public ref class FunctionTemplate : CppSharp::Parser::AST::Template diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs index fe8c0db530..c12579c6ca 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs @@ -14,6 +14,7 @@ [assembly:InternalsVisibleTo("CppSharp.Parser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace CppSharp { @@ -187,12 +188,12 @@ public NativeLibrary(global::CppSharp.Parser.AST.NativeLibrary _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -378,12 +379,12 @@ public Comment(global::CppSharp.Parser.AST.Comment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -602,7 +603,7 @@ public FullComment(global::CppSharp.Parser.AST.FullComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -850,7 +851,7 @@ public ParagraphComment(global::CppSharp.Parser.AST.ParagraphComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1043,12 +1044,12 @@ public Argument(global::CppSharp.Parser.AST.BlockCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1151,7 +1152,7 @@ public BlockCommandComment(global::CppSharp.Parser.AST.BlockCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1323,7 +1324,7 @@ public ParamCommandComment(global::CppSharp.Parser.AST.ParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1462,7 +1463,7 @@ public TParamCommandComment(global::CppSharp.Parser.AST.TParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1589,7 +1590,7 @@ public VerbatimBlockLineComment(global::CppSharp.Parser.AST.VerbatimBlockLineCom partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1716,7 +1717,7 @@ public VerbatimBlockComment(global::CppSharp.Parser.AST.VerbatimBlockComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1847,7 +1848,7 @@ public VerbatimLineComment(global::CppSharp.Parser.AST.VerbatimLineComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2018,12 +2019,12 @@ public Argument(global::CppSharp.Parser.AST.InlineCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2117,7 +2118,7 @@ public InlineCommandComment(global::CppSharp.Parser.AST.InlineCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2416,12 +2417,12 @@ public Attribute(global::CppSharp.Parser.AST.HTMLStartTagComment.Attribute _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2529,7 +2530,7 @@ public HTMLStartTagComment(global::CppSharp.Parser.AST.HTMLStartTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2673,7 +2674,7 @@ public HTMLEndTagComment(global::CppSharp.Parser.AST.HTMLEndTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2786,7 +2787,7 @@ public TextComment(global::CppSharp.Parser.AST.TextComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2918,12 +2919,12 @@ public RawComment(global::CppSharp.Parser.AST.RawComment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3017,7 +3018,7 @@ public partial struct __Internal } private SourceLocation.__Internal __instance; - internal SourceLocation.__Internal __Instance => __instance; + internal ref SourceLocation.__Internal __Instance => ref __instance; internal static SourceLocation __CreateInstance(__IntPtr native, bool skipVTables = false) { @@ -3040,6 +3041,14 @@ private SourceLocation(void* native, bool skipVTables = false) : this() __instance = *(global::CppSharp.Parser.SourceLocation.__Internal*) native; } + public SourceLocation() + { + fixed (__Internal* __instancePtr = &__instance) + { + __Internal.ctor(new __IntPtr(__instancePtr)); + } + } + public SourceLocation(uint ID) : this() { @@ -3175,12 +3184,12 @@ public SourceRange() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3402,12 +3411,12 @@ public Type(global::CppSharp.Parser.AST.Type _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3543,12 +3552,12 @@ public TypeQualifiers() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3695,12 +3704,12 @@ public QualifiedType(global::CppSharp.Parser.AST.QualifiedType _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4082,7 +4091,7 @@ public FunctionType(global::CppSharp.Parser.AST.FunctionType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4826,12 +4835,12 @@ public TemplateArgument(global::CppSharp.Parser.AST.TemplateArgument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4997,7 +5006,7 @@ public TemplateSpecializationType(global::CppSharp.Parser.AST.TemplateSpecializa partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5167,7 +5176,7 @@ public DependentTemplateSpecializationType(global::CppSharp.Parser.AST.Dependent partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5313,7 +5322,7 @@ public TemplateParameterType(global::CppSharp.Parser.AST.TemplateParameterType _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5688,7 +5697,7 @@ public DependentNameType(global::CppSharp.Parser.AST.DependentNameType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -6392,9 +6401,10 @@ public enum CppAbi Itanium = 0, Microsoft = 1, ARM = 2, - iOS = 3, - iOS64 = 4, - WebAssembly = 5 + AArch64 = 3, + iOS = 4, + AppleARM64 = 5, + WebAssembly = 6 } public enum RecordArgABI @@ -6574,12 +6584,12 @@ public Declaration(global::CppSharp.Parser.AST.Declaration _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7147,7 +7157,7 @@ public DeclarationContext(global::CppSharp.Parser.AST.DeclarationContext _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7554,7 +7564,7 @@ public TypedefNameDecl(global::CppSharp.Parser.AST.TypedefNameDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7693,7 +7703,7 @@ public TypedefDecl(global::CppSharp.Parser.AST.TypedefDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7813,7 +7823,7 @@ public TypeAlias(global::CppSharp.Parser.AST.TypeAlias _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7946,7 +7956,7 @@ public Friend(global::CppSharp.Parser.AST.Friend _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8082,12 +8092,12 @@ public StatementObsolete(global::CppSharp.Parser.AST.StatementObsolete _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8232,7 +8242,7 @@ public ExpressionObsolete(global::CppSharp.Parser.AST.ExpressionObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8344,7 +8354,7 @@ public BinaryOperatorObsolete(global::CppSharp.Parser.AST.BinaryOperatorObsolete partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8503,7 +8513,7 @@ public CallExprObsolete(global::CppSharp.Parser.AST.CallExprObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8650,7 +8660,7 @@ public CXXConstructExprObsolete(global::CppSharp.Parser.AST.CXXConstructExprObso partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8804,7 +8814,7 @@ public Parameter(global::CppSharp.Parser.AST.Parameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9047,7 +9057,7 @@ public Function(global::CppSharp.Parser.AST.Function _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9507,7 +9517,7 @@ public Method(global::CppSharp.Parser.AST.Method _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9878,7 +9888,7 @@ public Item(global::CppSharp.Parser.AST.Enumeration.Item _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9985,7 +9995,7 @@ public Enumeration(global::CppSharp.Parser.AST.Enumeration _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10189,7 +10199,7 @@ public Variable(global::CppSharp.Parser.AST.Variable _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10357,12 +10367,12 @@ public BaseClassSpecifier(global::CppSharp.Parser.AST.BaseClassSpecifier _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10535,7 +10545,7 @@ public Field(global::CppSharp.Parser.AST.Field _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10708,7 +10718,7 @@ public AccessSpecifierDecl(global::CppSharp.Parser.AST.AccessSpecifierDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10819,12 +10829,12 @@ public VTableComponent(global::CppSharp.Parser.AST.VTableComponent _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10989,12 +10999,12 @@ public VTableLayout(global::CppSharp.Parser.AST.VTableLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11141,12 +11151,12 @@ public VFTableInfo(global::CppSharp.Parser.AST.VFTableInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11318,12 +11328,12 @@ public LayoutField(global::CppSharp.Parser.AST.LayoutField other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11494,12 +11504,12 @@ public LayoutBase(global::CppSharp.Parser.AST.LayoutBase other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11687,12 +11697,12 @@ public ClassLayout(global::CppSharp.Parser.AST.ClassLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12084,7 +12094,7 @@ public Class(global::CppSharp.Parser.AST.Class _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12505,7 +12515,7 @@ public Template(global::CppSharp.Parser.AST.Template _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12674,7 +12684,7 @@ public TypeAliasTemplate(global::CppSharp.Parser.AST.TypeAliasTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12795,7 +12805,7 @@ public TemplateParameter(global::CppSharp.Parser.AST.TemplateParameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12962,7 +12972,7 @@ public TemplateTemplateParameter(global::CppSharp.Parser.AST.TemplateTemplatePar partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13123,7 +13133,7 @@ public TypeTemplateParameter(global::CppSharp.Parser.AST.TypeTemplateParameter _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13265,7 +13275,7 @@ public NonTypeTemplateParameter(global::CppSharp.Parser.AST.NonTypeTemplateParam partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13486,7 +13496,7 @@ public ClassTemplate(global::CppSharp.Parser.AST.ClassTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13698,7 +13708,7 @@ public ClassTemplateSpecialization(global::CppSharp.Parser.AST.ClassTemplateSpec partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13770,7 +13780,7 @@ public uint ArgumentsCount public unsafe partial class ClassTemplatePartialSpecialization : global::CppSharp.Parser.AST.ClassTemplateSpecialization, IDisposable { - [StructLayout(LayoutKind.Sequential, Size = 328)] + [StructLayout(LayoutKind.Sequential, Size = 340)] public new partial struct __Internal { internal global::CppSharp.Parser.AST.DeclarationKind kind; @@ -13825,6 +13835,7 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar internal __IntPtr templatedDecl; internal global::Std.Vector.__Internalc__N_std_N___1_S_vector____N_CppSharp_N_CppParser_N_AST_S_TemplateArgument___N_std_N___1_S_allocator__S0_ Arguments; internal global::CppSharp.Parser.AST.TemplateSpecializationKind specializationKind; + internal global::Std.Vector.__Internalc__N_std_N___1_S_vector_____N_CppSharp_N_CppParser_N_AST_S_Declaration___N_std_N___1_S_allocator__S0_ Parameters; [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecializationC2Ev", CallingConvention = __CallingConvention.Cdecl)] internal static extern void ctor(__IntPtr __instance); @@ -13834,6 +13845,18 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecializationD2Ev", CallingConvention = __CallingConvention.Cdecl)] internal static extern void dtor(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization13getParametersEj", CallingConvention = __CallingConvention.Cdecl)] + internal static extern __IntPtr GetParameters(__IntPtr __instance, uint i); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization13addParametersERPNS1_11DeclarationE", CallingConvention = __CallingConvention.Cdecl)] + internal static extern void AddParameters(__IntPtr __instance, __IntPtr s); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization15clearParametersEv", CallingConvention = __CallingConvention.Cdecl)] + internal static extern void ClearParameters(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization18getParametersCountEv", CallingConvention = __CallingConvention.Cdecl)] + internal static extern uint GetParametersCount(__IntPtr __instance); } internal static new ClassTemplatePartialSpecialization __CreateInstance(__IntPtr native, bool skipVTables = false) @@ -13902,7 +13925,7 @@ public ClassTemplatePartialSpecialization(global::CppSharp.Parser.AST.ClassTempl partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13914,6 +13937,36 @@ internal protected override void Dispose(bool disposing, bool callNativeDtor ) Marshal.FreeHGlobal(__Instance); __Instance = IntPtr.Zero; } + + public global::CppSharp.Parser.AST.Declaration GetParameters(uint i) + { + var ___ret = __Internal.GetParameters(__Instance, i); + var __result0 = global::CppSharp.Parser.AST.Declaration.__GetOrCreateInstance(___ret, false); + return __result0; + } + + public void AddParameters(global::CppSharp.Parser.AST.Declaration s) + { + if (ReferenceEquals(s, null)) + throw new global::System.ArgumentNullException("s", "Cannot be null because it is a C++ reference (&)."); + var ____arg0 = s.__Instance; + var __arg0 = new __IntPtr(&____arg0); + __Internal.AddParameters(__Instance, __arg0); + } + + public void ClearParameters() + { + __Internal.ClearParameters(__Instance); + } + + public uint ParametersCount + { + get + { + var ___ret = __Internal.GetParametersCount(__Instance); + return ___ret; + } + } } public unsafe partial class FunctionTemplate : global::CppSharp.Parser.AST.Template, IDisposable @@ -14038,7 +14091,7 @@ public FunctionTemplate(global::CppSharp.Parser.AST.FunctionTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14209,12 +14262,12 @@ public FunctionTemplateSpecialization(global::CppSharp.Parser.AST.FunctionTempla public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14423,7 +14476,7 @@ public VarTemplate(global::CppSharp.Parser.AST.VarTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14612,7 +14665,7 @@ public VarTemplateSpecialization(global::CppSharp.Parser.AST.VarTemplateSpeciali partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14793,7 +14846,7 @@ public VarTemplatePartialSpecialization(global::CppSharp.Parser.AST.VarTemplateP partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14911,7 +14964,7 @@ public UnresolvedUsingTypename(global::CppSharp.Parser.AST.UnresolvedUsingTypena partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15041,7 +15094,7 @@ public Namespace(global::CppSharp.Parser.AST.Namespace _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15165,12 +15218,12 @@ public PreprocessedEntity(global::CppSharp.Parser.AST.PreprocessedEntity _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15310,7 +15363,7 @@ public MacroDefinition(global::CppSharp.Parser.AST.MacroDefinition _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15466,7 +15519,7 @@ public MacroExpansion(global::CppSharp.Parser.AST.MacroExpansion _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15653,7 +15706,7 @@ public TranslationUnit(global::CppSharp.Parser.AST.TranslationUnit _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15840,12 +15893,12 @@ public ASTContext(global::CppSharp.Parser.AST.ASTContext _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16148,12 +16201,12 @@ public Stmt(global::CppSharp.Parser.AST.Stmt _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16325,7 +16378,7 @@ public DeclStmt(global::CppSharp.Parser.AST.DeclStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16608,7 +16661,7 @@ public CompoundStmt(global::CppSharp.Parser.AST.CompoundStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -18966,7 +19019,7 @@ public AsmStmt(global::CppSharp.Parser.AST.AsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19277,12 +19330,12 @@ public AsmStringPiece(global::CppSharp.Parser.AST.GCCAsmStmt.AsmStringPiece _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19428,7 +19481,7 @@ public GCCAsmStmt(global::CppSharp.Parser.AST.GCCAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19554,7 +19607,7 @@ public MSAsmStmt(global::CppSharp.Parser.AST.MSAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20255,12 +20308,12 @@ public Capture(global::CppSharp.Parser.AST.CapturedStmt.Capture _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20416,7 +20469,7 @@ public CapturedStmt(global::CppSharp.Parser.AST.CapturedStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -21279,12 +21332,12 @@ public CtorArgs(global::CppSharp.Parser.AST.CoroutineBodyStmt.CtorArgs _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -22107,12 +22160,12 @@ public Classification(global::CppSharp.Parser.AST.Expr.Classification _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -23860,7 +23913,7 @@ public StringLiteral(global::CppSharp.Parser.AST.StringLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -25233,7 +25286,7 @@ public CallExpr(global::CppSharp.Parser.AST.CallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26539,7 +26592,7 @@ public BinaryOperator(global::CppSharp.Parser.AST.BinaryOperator _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26929,7 +26982,7 @@ public CompoundAssignOperator(global::CppSharp.Parser.AST.CompoundAssignOperator partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -28812,12 +28865,12 @@ public Designator(global::CppSharp.Parser.AST.DesignatedInitExpr.Designator _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29068,12 +29121,12 @@ public FieldDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.FieldDesig public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29178,12 +29231,12 @@ public ArrayOrRangeDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.Arr public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31346,7 +31399,7 @@ public CXXOperatorCallExpr(global::CppSharp.Parser.AST.CXXOperatorCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31523,7 +31576,7 @@ public CXXMemberCallExpr(global::CppSharp.Parser.AST.CXXMemberCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31675,7 +31728,7 @@ public CUDAKernelCallExpr(global::CppSharp.Parser.AST.CUDAKernelCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -32450,7 +32503,7 @@ public UserDefinedLiteral(global::CppSharp.Parser.AST.UserDefinedLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -33366,7 +33419,7 @@ public CXXUuidofExpr(global::CppSharp.Parser.AST.CXXUuidofExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34172,7 +34225,7 @@ public CXXConstructExpr(global::CppSharp.Parser.AST.CXXConstructExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34714,7 +34767,7 @@ public CXXTemporaryObjectExpr(global::CppSharp.Parser.AST.CXXTemporaryObjectExpr partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34850,7 +34903,7 @@ public LambdaExpr(global::CppSharp.Parser.AST.LambdaExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -35256,7 +35309,7 @@ public CXXNewExpr(global::CppSharp.Parser.AST.CXXNewExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -36398,12 +36451,12 @@ public FindResult(global::CppSharp.Parser.AST.OverloadExpr.FindResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -37155,7 +37208,7 @@ public CXXUnresolvedConstructExpr(global::CppSharp.Parser.AST.CXXUnresolvedConst partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -38663,12 +38716,12 @@ public ExtraState(global::CppSharp.Parser.AST.MaterializeTemporaryExpr.ExtraStat public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -39755,12 +39808,12 @@ public ParserTargetInfo(global::CppSharp.Parser.ParserTargetInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -40641,12 +40694,12 @@ public CppParserOptions(global::CppSharp.Parser.CppParserOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41182,12 +41235,12 @@ public CppLinkerOptions(global::CppSharp.Parser.CppLinkerOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41381,12 +41434,12 @@ public ParserDiagnostic(global::CppSharp.Parser.ParserDiagnostic _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41595,12 +41648,12 @@ public ParserResult(global::CppSharp.Parser.ParserResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41806,12 +41859,12 @@ public ClangParser(global::CppSharp.Parser.ClangParser _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std.cs b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std.cs index c7e2920adf..f6c861347f 100644 --- a/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std.cs +++ b/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std.cs @@ -16,6 +16,7 @@ [assembly:InternalsVisibleTo("CppSharp.CppParser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace Std { @@ -147,12 +148,12 @@ public Allocator() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -280,12 +281,12 @@ protected CharTraits(void* native, bool skipVTables = false) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -485,12 +486,12 @@ public BasicString() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs index 076c7153e9..929151367b 100644 --- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs @@ -14,6 +14,7 @@ [assembly:InternalsVisibleTo("CppSharp.Parser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace CppSharp { @@ -187,12 +188,12 @@ public NativeLibrary(global::CppSharp.Parser.AST.NativeLibrary _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -378,12 +379,12 @@ public Comment(global::CppSharp.Parser.AST.Comment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -602,7 +603,7 @@ public FullComment(global::CppSharp.Parser.AST.FullComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -850,7 +851,7 @@ public ParagraphComment(global::CppSharp.Parser.AST.ParagraphComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1043,12 +1044,12 @@ public Argument(global::CppSharp.Parser.AST.BlockCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1151,7 +1152,7 @@ public BlockCommandComment(global::CppSharp.Parser.AST.BlockCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1323,7 +1324,7 @@ public ParamCommandComment(global::CppSharp.Parser.AST.ParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1462,7 +1463,7 @@ public TParamCommandComment(global::CppSharp.Parser.AST.TParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1589,7 +1590,7 @@ public VerbatimBlockLineComment(global::CppSharp.Parser.AST.VerbatimBlockLineCom partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1716,7 +1717,7 @@ public VerbatimBlockComment(global::CppSharp.Parser.AST.VerbatimBlockComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1847,7 +1848,7 @@ public VerbatimLineComment(global::CppSharp.Parser.AST.VerbatimLineComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2018,12 +2019,12 @@ public Argument(global::CppSharp.Parser.AST.InlineCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2117,7 +2118,7 @@ public InlineCommandComment(global::CppSharp.Parser.AST.InlineCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2416,12 +2417,12 @@ public Attribute(global::CppSharp.Parser.AST.HTMLStartTagComment.Attribute _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2529,7 +2530,7 @@ public HTMLStartTagComment(global::CppSharp.Parser.AST.HTMLStartTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2673,7 +2674,7 @@ public HTMLEndTagComment(global::CppSharp.Parser.AST.HTMLEndTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2786,7 +2787,7 @@ public TextComment(global::CppSharp.Parser.AST.TextComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2918,12 +2919,12 @@ public RawComment(global::CppSharp.Parser.AST.RawComment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3017,7 +3018,7 @@ public partial struct __Internal } private SourceLocation.__Internal __instance; - internal SourceLocation.__Internal __Instance => __instance; + internal ref SourceLocation.__Internal __Instance => ref __instance; internal static SourceLocation __CreateInstance(__IntPtr native, bool skipVTables = false) { @@ -3040,6 +3041,14 @@ private SourceLocation(void* native, bool skipVTables = false) : this() __instance = *(global::CppSharp.Parser.SourceLocation.__Internal*) native; } + public SourceLocation() + { + fixed (__Internal* __instancePtr = &__instance) + { + __Internal.ctor(new __IntPtr(__instancePtr)); + } + } + public SourceLocation(uint ID) : this() { @@ -3175,12 +3184,12 @@ public SourceRange() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3402,12 +3411,12 @@ public Type(global::CppSharp.Parser.AST.Type _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3543,12 +3552,12 @@ public TypeQualifiers() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3695,12 +3704,12 @@ public QualifiedType(global::CppSharp.Parser.AST.QualifiedType _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4082,7 +4091,7 @@ public FunctionType(global::CppSharp.Parser.AST.FunctionType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4826,12 +4835,12 @@ public TemplateArgument(global::CppSharp.Parser.AST.TemplateArgument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4997,7 +5006,7 @@ public TemplateSpecializationType(global::CppSharp.Parser.AST.TemplateSpecializa partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5167,7 +5176,7 @@ public DependentTemplateSpecializationType(global::CppSharp.Parser.AST.Dependent partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5313,7 +5322,7 @@ public TemplateParameterType(global::CppSharp.Parser.AST.TemplateParameterType _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5688,7 +5697,7 @@ public DependentNameType(global::CppSharp.Parser.AST.DependentNameType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -6392,9 +6401,10 @@ public enum CppAbi Itanium = 0, Microsoft = 1, ARM = 2, - iOS = 3, - iOS64 = 4, - WebAssembly = 5 + AArch64 = 3, + iOS = 4, + AppleARM64 = 5, + WebAssembly = 6 } public enum RecordArgABI @@ -6574,12 +6584,12 @@ public Declaration(global::CppSharp.Parser.AST.Declaration _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7147,7 +7157,7 @@ public DeclarationContext(global::CppSharp.Parser.AST.DeclarationContext _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7554,7 +7564,7 @@ public TypedefNameDecl(global::CppSharp.Parser.AST.TypedefNameDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7693,7 +7703,7 @@ public TypedefDecl(global::CppSharp.Parser.AST.TypedefDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7813,7 +7823,7 @@ public TypeAlias(global::CppSharp.Parser.AST.TypeAlias _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7946,7 +7956,7 @@ public Friend(global::CppSharp.Parser.AST.Friend _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8082,12 +8092,12 @@ public StatementObsolete(global::CppSharp.Parser.AST.StatementObsolete _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8232,7 +8242,7 @@ public ExpressionObsolete(global::CppSharp.Parser.AST.ExpressionObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8344,7 +8354,7 @@ public BinaryOperatorObsolete(global::CppSharp.Parser.AST.BinaryOperatorObsolete partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8503,7 +8513,7 @@ public CallExprObsolete(global::CppSharp.Parser.AST.CallExprObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8650,7 +8660,7 @@ public CXXConstructExprObsolete(global::CppSharp.Parser.AST.CXXConstructExprObso partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8804,7 +8814,7 @@ public Parameter(global::CppSharp.Parser.AST.Parameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9047,7 +9057,7 @@ public Function(global::CppSharp.Parser.AST.Function _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9507,7 +9517,7 @@ public Method(global::CppSharp.Parser.AST.Method _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9878,7 +9888,7 @@ public Item(global::CppSharp.Parser.AST.Enumeration.Item _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9985,7 +9995,7 @@ public Enumeration(global::CppSharp.Parser.AST.Enumeration _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10189,7 +10199,7 @@ public Variable(global::CppSharp.Parser.AST.Variable _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10357,12 +10367,12 @@ public BaseClassSpecifier(global::CppSharp.Parser.AST.BaseClassSpecifier _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10535,7 +10545,7 @@ public Field(global::CppSharp.Parser.AST.Field _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10708,7 +10718,7 @@ public AccessSpecifierDecl(global::CppSharp.Parser.AST.AccessSpecifierDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10819,12 +10829,12 @@ public VTableComponent(global::CppSharp.Parser.AST.VTableComponent _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10989,12 +10999,12 @@ public VTableLayout(global::CppSharp.Parser.AST.VTableLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11141,12 +11151,12 @@ public VFTableInfo(global::CppSharp.Parser.AST.VFTableInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11318,12 +11328,12 @@ public LayoutField(global::CppSharp.Parser.AST.LayoutField other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11494,12 +11504,12 @@ public LayoutBase(global::CppSharp.Parser.AST.LayoutBase other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11687,12 +11697,12 @@ public ClassLayout(global::CppSharp.Parser.AST.ClassLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12084,7 +12094,7 @@ public Class(global::CppSharp.Parser.AST.Class _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12505,7 +12515,7 @@ public Template(global::CppSharp.Parser.AST.Template _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12674,7 +12684,7 @@ public TypeAliasTemplate(global::CppSharp.Parser.AST.TypeAliasTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12795,7 +12805,7 @@ public TemplateParameter(global::CppSharp.Parser.AST.TemplateParameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12962,7 +12972,7 @@ public TemplateTemplateParameter(global::CppSharp.Parser.AST.TemplateTemplatePar partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13123,7 +13133,7 @@ public TypeTemplateParameter(global::CppSharp.Parser.AST.TypeTemplateParameter _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13265,7 +13275,7 @@ public NonTypeTemplateParameter(global::CppSharp.Parser.AST.NonTypeTemplateParam partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13486,7 +13496,7 @@ public ClassTemplate(global::CppSharp.Parser.AST.ClassTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13698,7 +13708,7 @@ public ClassTemplateSpecialization(global::CppSharp.Parser.AST.ClassTemplateSpec partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13770,7 +13780,7 @@ public uint ArgumentsCount public unsafe partial class ClassTemplatePartialSpecialization : global::CppSharp.Parser.AST.ClassTemplateSpecialization, IDisposable { - [StructLayout(LayoutKind.Sequential, Size = 360)] + [StructLayout(LayoutKind.Sequential, Size = 372)] public new partial struct __Internal { internal global::CppSharp.Parser.AST.DeclarationKind kind; @@ -13825,6 +13835,7 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar internal __IntPtr templatedDecl; internal global::Std.Vector.__Internalc__N_std_S_vector____N_CppSharp_N_CppParser_N_AST_S_TemplateArgument___N_std_S_allocator__S0_ Arguments; internal global::CppSharp.Parser.AST.TemplateSpecializationKind specializationKind; + internal global::Std.Vector.__Internalc__N_std_S_vector_____N_CppSharp_N_CppParser_N_AST_S_Declaration___N_std_S_allocator__S0_ Parameters; [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "??0ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QAE@XZ", CallingConvention = __CallingConvention.ThisCall)] internal static extern __IntPtr ctor(__IntPtr __instance); @@ -13834,6 +13845,18 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "??1ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QAE@XZ", CallingConvention = __CallingConvention.ThisCall)] internal static extern void dtor(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "?getParameters@ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QAEPAVDeclaration@234@I@Z", CallingConvention = __CallingConvention.ThisCall)] + internal static extern __IntPtr GetParameters(__IntPtr __instance, uint i); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "?addParameters@ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QAEXAAPAVDeclaration@234@@Z", CallingConvention = __CallingConvention.ThisCall)] + internal static extern void AddParameters(__IntPtr __instance, __IntPtr s); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "?clearParameters@ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QAEXXZ", CallingConvention = __CallingConvention.ThisCall)] + internal static extern void ClearParameters(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "?getParametersCount@ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QAEIXZ", CallingConvention = __CallingConvention.ThisCall)] + internal static extern uint GetParametersCount(__IntPtr __instance); } internal static new ClassTemplatePartialSpecialization __CreateInstance(__IntPtr native, bool skipVTables = false) @@ -13902,7 +13925,7 @@ public ClassTemplatePartialSpecialization(global::CppSharp.Parser.AST.ClassTempl partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13914,6 +13937,36 @@ internal protected override void Dispose(bool disposing, bool callNativeDtor ) Marshal.FreeHGlobal(__Instance); __Instance = IntPtr.Zero; } + + public global::CppSharp.Parser.AST.Declaration GetParameters(uint i) + { + var ___ret = __Internal.GetParameters(__Instance, i); + var __result0 = global::CppSharp.Parser.AST.Declaration.__GetOrCreateInstance(___ret, false); + return __result0; + } + + public void AddParameters(global::CppSharp.Parser.AST.Declaration s) + { + if (ReferenceEquals(s, null)) + throw new global::System.ArgumentNullException("s", "Cannot be null because it is a C++ reference (&)."); + var ____arg0 = s.__Instance; + var __arg0 = new __IntPtr(&____arg0); + __Internal.AddParameters(__Instance, __arg0); + } + + public void ClearParameters() + { + __Internal.ClearParameters(__Instance); + } + + public uint ParametersCount + { + get + { + var ___ret = __Internal.GetParametersCount(__Instance); + return ___ret; + } + } } public unsafe partial class FunctionTemplate : global::CppSharp.Parser.AST.Template, IDisposable @@ -14038,7 +14091,7 @@ public FunctionTemplate(global::CppSharp.Parser.AST.FunctionTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14209,12 +14262,12 @@ public FunctionTemplateSpecialization(global::CppSharp.Parser.AST.FunctionTempla public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14423,7 +14476,7 @@ public VarTemplate(global::CppSharp.Parser.AST.VarTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14612,7 +14665,7 @@ public VarTemplateSpecialization(global::CppSharp.Parser.AST.VarTemplateSpeciali partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14793,7 +14846,7 @@ public VarTemplatePartialSpecialization(global::CppSharp.Parser.AST.VarTemplateP partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14911,7 +14964,7 @@ public UnresolvedUsingTypename(global::CppSharp.Parser.AST.UnresolvedUsingTypena partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15042,7 +15095,7 @@ public Namespace(global::CppSharp.Parser.AST.Namespace _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15166,12 +15219,12 @@ public PreprocessedEntity(global::CppSharp.Parser.AST.PreprocessedEntity _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15311,7 +15364,7 @@ public MacroDefinition(global::CppSharp.Parser.AST.MacroDefinition _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15467,7 +15520,7 @@ public MacroExpansion(global::CppSharp.Parser.AST.MacroExpansion _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15655,7 +15708,7 @@ public TranslationUnit(global::CppSharp.Parser.AST.TranslationUnit _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15842,12 +15895,12 @@ public ASTContext(global::CppSharp.Parser.AST.ASTContext _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16150,12 +16203,12 @@ public Stmt(global::CppSharp.Parser.AST.Stmt _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16327,7 +16380,7 @@ public DeclStmt(global::CppSharp.Parser.AST.DeclStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16610,7 +16663,7 @@ public CompoundStmt(global::CppSharp.Parser.AST.CompoundStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -18968,7 +19021,7 @@ public AsmStmt(global::CppSharp.Parser.AST.AsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19279,12 +19332,12 @@ public AsmStringPiece(global::CppSharp.Parser.AST.GCCAsmStmt.AsmStringPiece _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19430,7 +19483,7 @@ public GCCAsmStmt(global::CppSharp.Parser.AST.GCCAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19556,7 +19609,7 @@ public MSAsmStmt(global::CppSharp.Parser.AST.MSAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20257,12 +20310,12 @@ public Capture(global::CppSharp.Parser.AST.CapturedStmt.Capture _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20418,7 +20471,7 @@ public CapturedStmt(global::CppSharp.Parser.AST.CapturedStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -21281,12 +21334,12 @@ public CtorArgs(global::CppSharp.Parser.AST.CoroutineBodyStmt.CtorArgs _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -22109,12 +22162,12 @@ public Classification(global::CppSharp.Parser.AST.Expr.Classification _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -23864,7 +23917,7 @@ public StringLiteral(global::CppSharp.Parser.AST.StringLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -25237,7 +25290,7 @@ public CallExpr(global::CppSharp.Parser.AST.CallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26543,7 +26596,7 @@ public BinaryOperator(global::CppSharp.Parser.AST.BinaryOperator _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26933,7 +26986,7 @@ public CompoundAssignOperator(global::CppSharp.Parser.AST.CompoundAssignOperator partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -28817,12 +28870,12 @@ public Designator(global::CppSharp.Parser.AST.DesignatedInitExpr.Designator _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29073,12 +29126,12 @@ public FieldDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.FieldDesig public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29183,12 +29236,12 @@ public ArrayOrRangeDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.Arr public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31351,7 +31404,7 @@ public CXXOperatorCallExpr(global::CppSharp.Parser.AST.CXXOperatorCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31528,7 +31581,7 @@ public CXXMemberCallExpr(global::CppSharp.Parser.AST.CXXMemberCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31680,7 +31733,7 @@ public CUDAKernelCallExpr(global::CppSharp.Parser.AST.CUDAKernelCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -32455,7 +32508,7 @@ public UserDefinedLiteral(global::CppSharp.Parser.AST.UserDefinedLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -33373,7 +33426,7 @@ public CXXUuidofExpr(global::CppSharp.Parser.AST.CXXUuidofExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34179,7 +34232,7 @@ public CXXConstructExpr(global::CppSharp.Parser.AST.CXXConstructExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34722,7 +34775,7 @@ public CXXTemporaryObjectExpr(global::CppSharp.Parser.AST.CXXTemporaryObjectExpr partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34858,7 +34911,7 @@ public LambdaExpr(global::CppSharp.Parser.AST.LambdaExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -35264,7 +35317,7 @@ public CXXNewExpr(global::CppSharp.Parser.AST.CXXNewExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -36408,12 +36461,12 @@ public FindResult(global::CppSharp.Parser.AST.OverloadExpr.FindResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -37165,7 +37218,7 @@ public CXXUnresolvedConstructExpr(global::CppSharp.Parser.AST.CXXUnresolvedConst partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -38674,12 +38727,12 @@ public ExtraState(global::CppSharp.Parser.AST.MaterializeTemporaryExpr.ExtraStat public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -39766,12 +39819,12 @@ public ParserTargetInfo(global::CppSharp.Parser.ParserTargetInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -40652,12 +40705,12 @@ public CppParserOptions(global::CppSharp.Parser.CppParserOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41193,12 +41246,12 @@ public CppLinkerOptions(global::CppSharp.Parser.CppLinkerOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41392,12 +41445,12 @@ public ParserDiagnostic(global::CppSharp.Parser.ParserDiagnostic _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41606,12 +41659,12 @@ public ParserResult(global::CppSharp.Parser.ParserResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41817,12 +41870,12 @@ public ClangParser(global::CppSharp.Parser.ClangParser _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Std.cs b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Std.cs index 7ebca0dad1..e44bd1f9ee 100644 --- a/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Std.cs +++ b/src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Std.cs @@ -16,6 +16,7 @@ [assembly:InternalsVisibleTo("CppSharp.CppParser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace Std { @@ -160,17 +161,26 @@ public Allocator() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; NativeToManagedMap.TryRemove(__Instance, out _); DisposePartial(disposing); + if (callNativeDtor) + { + var ___Ty = typeof(_Ty); + if (___Ty.IsAssignableFrom(typeof(sbyte))) + { + return; + } + throw new ArgumentOutOfRangeException("_Ty", string.Join(", ", new[] { typeof(_Ty).FullName }), "global::Std.Allocator<_Ty> maps a C++ template class and therefore it only supports a limited set of types and their subclasses: ."); + } if (__ownsNativeInstance) Marshal.FreeHGlobal(__Instance); __Instance = IntPtr.Zero; @@ -299,12 +309,12 @@ public BasicString() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -431,12 +441,12 @@ protected CharTraits(void* native, bool skipVTables = false) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs index 0aee6b458e..2c6915daa5 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs @@ -14,6 +14,7 @@ [assembly:InternalsVisibleTo("CppSharp.Parser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace CppSharp { @@ -187,12 +188,12 @@ public NativeLibrary(global::CppSharp.Parser.AST.NativeLibrary _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -378,12 +379,12 @@ public Comment(global::CppSharp.Parser.AST.Comment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -602,7 +603,7 @@ public FullComment(global::CppSharp.Parser.AST.FullComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -850,7 +851,7 @@ public ParagraphComment(global::CppSharp.Parser.AST.ParagraphComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1043,12 +1044,12 @@ public Argument(global::CppSharp.Parser.AST.BlockCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1151,7 +1152,7 @@ public BlockCommandComment(global::CppSharp.Parser.AST.BlockCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1323,7 +1324,7 @@ public ParamCommandComment(global::CppSharp.Parser.AST.ParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1462,7 +1463,7 @@ public TParamCommandComment(global::CppSharp.Parser.AST.TParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1589,7 +1590,7 @@ public VerbatimBlockLineComment(global::CppSharp.Parser.AST.VerbatimBlockLineCom partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1716,7 +1717,7 @@ public VerbatimBlockComment(global::CppSharp.Parser.AST.VerbatimBlockComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1847,7 +1848,7 @@ public VerbatimLineComment(global::CppSharp.Parser.AST.VerbatimLineComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2018,12 +2019,12 @@ public Argument(global::CppSharp.Parser.AST.InlineCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2117,7 +2118,7 @@ public InlineCommandComment(global::CppSharp.Parser.AST.InlineCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2416,12 +2417,12 @@ public Attribute(global::CppSharp.Parser.AST.HTMLStartTagComment.Attribute _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2529,7 +2530,7 @@ public HTMLStartTagComment(global::CppSharp.Parser.AST.HTMLStartTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2673,7 +2674,7 @@ public HTMLEndTagComment(global::CppSharp.Parser.AST.HTMLEndTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2786,7 +2787,7 @@ public TextComment(global::CppSharp.Parser.AST.TextComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2918,12 +2919,12 @@ public RawComment(global::CppSharp.Parser.AST.RawComment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3017,7 +3018,7 @@ public partial struct __Internal } private SourceLocation.__Internal __instance; - internal SourceLocation.__Internal __Instance => __instance; + internal ref SourceLocation.__Internal __Instance => ref __instance; internal static SourceLocation __CreateInstance(__IntPtr native, bool skipVTables = false) { @@ -3040,6 +3041,14 @@ private SourceLocation(void* native, bool skipVTables = false) : this() __instance = *(global::CppSharp.Parser.SourceLocation.__Internal*) native; } + public SourceLocation() + { + fixed (__Internal* __instancePtr = &__instance) + { + __Internal.ctor(new __IntPtr(__instancePtr)); + } + } + public SourceLocation(uint ID) : this() { @@ -3175,12 +3184,12 @@ public SourceRange() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3402,12 +3411,12 @@ public Type(global::CppSharp.Parser.AST.Type _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3543,12 +3552,12 @@ public TypeQualifiers() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3695,12 +3704,12 @@ public QualifiedType(global::CppSharp.Parser.AST.QualifiedType _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4082,7 +4091,7 @@ public FunctionType(global::CppSharp.Parser.AST.FunctionType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4826,12 +4835,12 @@ public TemplateArgument(global::CppSharp.Parser.AST.TemplateArgument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4997,7 +5006,7 @@ public TemplateSpecializationType(global::CppSharp.Parser.AST.TemplateSpecializa partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5167,7 +5176,7 @@ public DependentTemplateSpecializationType(global::CppSharp.Parser.AST.Dependent partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5313,7 +5322,7 @@ public TemplateParameterType(global::CppSharp.Parser.AST.TemplateParameterType _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5688,7 +5697,7 @@ public DependentNameType(global::CppSharp.Parser.AST.DependentNameType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -6392,9 +6401,10 @@ public enum CppAbi Itanium = 0, Microsoft = 1, ARM = 2, - iOS = 3, - iOS64 = 4, - WebAssembly = 5 + AArch64 = 3, + iOS = 4, + AppleARM64 = 5, + WebAssembly = 6 } public enum RecordArgABI @@ -6574,12 +6584,12 @@ public Declaration(global::CppSharp.Parser.AST.Declaration _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7147,7 +7157,7 @@ public DeclarationContext(global::CppSharp.Parser.AST.DeclarationContext _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7554,7 +7564,7 @@ public TypedefNameDecl(global::CppSharp.Parser.AST.TypedefNameDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7693,7 +7703,7 @@ public TypedefDecl(global::CppSharp.Parser.AST.TypedefDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7813,7 +7823,7 @@ public TypeAlias(global::CppSharp.Parser.AST.TypeAlias _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7946,7 +7956,7 @@ public Friend(global::CppSharp.Parser.AST.Friend _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8082,12 +8092,12 @@ public StatementObsolete(global::CppSharp.Parser.AST.StatementObsolete _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8232,7 +8242,7 @@ public ExpressionObsolete(global::CppSharp.Parser.AST.ExpressionObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8344,7 +8354,7 @@ public BinaryOperatorObsolete(global::CppSharp.Parser.AST.BinaryOperatorObsolete partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8503,7 +8513,7 @@ public CallExprObsolete(global::CppSharp.Parser.AST.CallExprObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8650,7 +8660,7 @@ public CXXConstructExprObsolete(global::CppSharp.Parser.AST.CXXConstructExprObso partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8804,7 +8814,7 @@ public Parameter(global::CppSharp.Parser.AST.Parameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9047,7 +9057,7 @@ public Function(global::CppSharp.Parser.AST.Function _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9507,7 +9517,7 @@ public Method(global::CppSharp.Parser.AST.Method _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9878,7 +9888,7 @@ public Item(global::CppSharp.Parser.AST.Enumeration.Item _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9985,7 +9995,7 @@ public Enumeration(global::CppSharp.Parser.AST.Enumeration _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10189,7 +10199,7 @@ public Variable(global::CppSharp.Parser.AST.Variable _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10357,12 +10367,12 @@ public BaseClassSpecifier(global::CppSharp.Parser.AST.BaseClassSpecifier _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10535,7 +10545,7 @@ public Field(global::CppSharp.Parser.AST.Field _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10708,7 +10718,7 @@ public AccessSpecifierDecl(global::CppSharp.Parser.AST.AccessSpecifierDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10819,12 +10829,12 @@ public VTableComponent(global::CppSharp.Parser.AST.VTableComponent _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10989,12 +10999,12 @@ public VTableLayout(global::CppSharp.Parser.AST.VTableLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11140,12 +11150,12 @@ public VFTableInfo(global::CppSharp.Parser.AST.VFTableInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11317,12 +11327,12 @@ public LayoutField(global::CppSharp.Parser.AST.LayoutField other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11493,12 +11503,12 @@ public LayoutBase(global::CppSharp.Parser.AST.LayoutBase other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11686,12 +11696,12 @@ public ClassLayout(global::CppSharp.Parser.AST.ClassLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12083,7 +12093,7 @@ public Class(global::CppSharp.Parser.AST.Class _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12504,7 +12514,7 @@ public Template(global::CppSharp.Parser.AST.Template _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12673,7 +12683,7 @@ public TypeAliasTemplate(global::CppSharp.Parser.AST.TypeAliasTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12794,7 +12804,7 @@ public TemplateParameter(global::CppSharp.Parser.AST.TemplateParameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12961,7 +12971,7 @@ public TemplateTemplateParameter(global::CppSharp.Parser.AST.TemplateTemplatePar partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13122,7 +13132,7 @@ public TypeTemplateParameter(global::CppSharp.Parser.AST.TypeTemplateParameter _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13264,7 +13274,7 @@ public NonTypeTemplateParameter(global::CppSharp.Parser.AST.NonTypeTemplateParam partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13485,7 +13495,7 @@ public ClassTemplate(global::CppSharp.Parser.AST.ClassTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13697,7 +13707,7 @@ public ClassTemplateSpecialization(global::CppSharp.Parser.AST.ClassTemplateSpec partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13769,7 +13779,7 @@ public uint ArgumentsCount public unsafe partial class ClassTemplatePartialSpecialization : global::CppSharp.Parser.AST.ClassTemplateSpecialization, IDisposable { - [StructLayout(LayoutKind.Sequential, Size = 608)] + [StructLayout(LayoutKind.Sequential, Size = 632)] public new partial struct __Internal { internal global::CppSharp.Parser.AST.DeclarationKind kind; @@ -13824,6 +13834,7 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar internal __IntPtr templatedDecl; internal global::Std.Vector.__Internalc__N_std_N___1_S_vector____N_CppSharp_N_CppParser_N_AST_S_TemplateArgument___N_std_N___1_S_allocator__S0_ Arguments; internal global::CppSharp.Parser.AST.TemplateSpecializationKind specializationKind; + internal global::Std.Vector.__Internalc__N_std_N___1_S_vector_____N_CppSharp_N_CppParser_N_AST_S_Declaration___N_std_N___1_S_allocator__S0_ Parameters; [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecializationC2Ev", CallingConvention = __CallingConvention.Cdecl)] internal static extern void ctor(__IntPtr __instance); @@ -13833,6 +13844,18 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecializationD2Ev", CallingConvention = __CallingConvention.Cdecl)] internal static extern void dtor(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization13getParametersEj", CallingConvention = __CallingConvention.Cdecl)] + internal static extern __IntPtr GetParameters(__IntPtr __instance, uint i); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization13addParametersERPNS1_11DeclarationE", CallingConvention = __CallingConvention.Cdecl)] + internal static extern void AddParameters(__IntPtr __instance, __IntPtr s); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization15clearParametersEv", CallingConvention = __CallingConvention.Cdecl)] + internal static extern void ClearParameters(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization18getParametersCountEv", CallingConvention = __CallingConvention.Cdecl)] + internal static extern uint GetParametersCount(__IntPtr __instance); } internal static new ClassTemplatePartialSpecialization __CreateInstance(__IntPtr native, bool skipVTables = false) @@ -13901,7 +13924,7 @@ public ClassTemplatePartialSpecialization(global::CppSharp.Parser.AST.ClassTempl partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13913,6 +13936,36 @@ internal protected override void Dispose(bool disposing, bool callNativeDtor ) Marshal.FreeHGlobal(__Instance); __Instance = IntPtr.Zero; } + + public global::CppSharp.Parser.AST.Declaration GetParameters(uint i) + { + var ___ret = __Internal.GetParameters(__Instance, i); + var __result0 = global::CppSharp.Parser.AST.Declaration.__GetOrCreateInstance(___ret, false); + return __result0; + } + + public void AddParameters(global::CppSharp.Parser.AST.Declaration s) + { + if (ReferenceEquals(s, null)) + throw new global::System.ArgumentNullException("s", "Cannot be null because it is a C++ reference (&)."); + var ____arg0 = s.__Instance; + var __arg0 = new __IntPtr(&____arg0); + __Internal.AddParameters(__Instance, __arg0); + } + + public void ClearParameters() + { + __Internal.ClearParameters(__Instance); + } + + public uint ParametersCount + { + get + { + var ___ret = __Internal.GetParametersCount(__Instance); + return ___ret; + } + } } public unsafe partial class FunctionTemplate : global::CppSharp.Parser.AST.Template, IDisposable @@ -14037,7 +14090,7 @@ public FunctionTemplate(global::CppSharp.Parser.AST.FunctionTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14208,12 +14261,12 @@ public FunctionTemplateSpecialization(global::CppSharp.Parser.AST.FunctionTempla public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14422,7 +14475,7 @@ public VarTemplate(global::CppSharp.Parser.AST.VarTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14611,7 +14664,7 @@ public VarTemplateSpecialization(global::CppSharp.Parser.AST.VarTemplateSpeciali partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14792,7 +14845,7 @@ public VarTemplatePartialSpecialization(global::CppSharp.Parser.AST.VarTemplateP partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14910,7 +14963,7 @@ public UnresolvedUsingTypename(global::CppSharp.Parser.AST.UnresolvedUsingTypena partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15040,7 +15093,7 @@ public Namespace(global::CppSharp.Parser.AST.Namespace _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15164,12 +15217,12 @@ public PreprocessedEntity(global::CppSharp.Parser.AST.PreprocessedEntity _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15309,7 +15362,7 @@ public MacroDefinition(global::CppSharp.Parser.AST.MacroDefinition _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15465,7 +15518,7 @@ public MacroExpansion(global::CppSharp.Parser.AST.MacroExpansion _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15652,7 +15705,7 @@ public TranslationUnit(global::CppSharp.Parser.AST.TranslationUnit _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15839,12 +15892,12 @@ public ASTContext(global::CppSharp.Parser.AST.ASTContext _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16147,12 +16200,12 @@ public Stmt(global::CppSharp.Parser.AST.Stmt _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16324,7 +16377,7 @@ public DeclStmt(global::CppSharp.Parser.AST.DeclStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16607,7 +16660,7 @@ public CompoundStmt(global::CppSharp.Parser.AST.CompoundStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -18965,7 +19018,7 @@ public AsmStmt(global::CppSharp.Parser.AST.AsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19276,12 +19329,12 @@ public AsmStringPiece(global::CppSharp.Parser.AST.GCCAsmStmt.AsmStringPiece _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19427,7 +19480,7 @@ public GCCAsmStmt(global::CppSharp.Parser.AST.GCCAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19553,7 +19606,7 @@ public MSAsmStmt(global::CppSharp.Parser.AST.MSAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20254,12 +20307,12 @@ public Capture(global::CppSharp.Parser.AST.CapturedStmt.Capture _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20415,7 +20468,7 @@ public CapturedStmt(global::CppSharp.Parser.AST.CapturedStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -21278,12 +21331,12 @@ public CtorArgs(global::CppSharp.Parser.AST.CoroutineBodyStmt.CtorArgs _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -22106,12 +22159,12 @@ public Classification(global::CppSharp.Parser.AST.Expr.Classification _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -23859,7 +23912,7 @@ public StringLiteral(global::CppSharp.Parser.AST.StringLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -25232,7 +25285,7 @@ public CallExpr(global::CppSharp.Parser.AST.CallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26538,7 +26591,7 @@ public BinaryOperator(global::CppSharp.Parser.AST.BinaryOperator _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26928,7 +26981,7 @@ public CompoundAssignOperator(global::CppSharp.Parser.AST.CompoundAssignOperator partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -28811,12 +28864,12 @@ public Designator(global::CppSharp.Parser.AST.DesignatedInitExpr.Designator _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29067,12 +29120,12 @@ public FieldDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.FieldDesig public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29177,12 +29230,12 @@ public ArrayOrRangeDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.Arr public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31345,7 +31398,7 @@ public CXXOperatorCallExpr(global::CppSharp.Parser.AST.CXXOperatorCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31522,7 +31575,7 @@ public CXXMemberCallExpr(global::CppSharp.Parser.AST.CXXMemberCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31674,7 +31727,7 @@ public CUDAKernelCallExpr(global::CppSharp.Parser.AST.CUDAKernelCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -32449,7 +32502,7 @@ public UserDefinedLiteral(global::CppSharp.Parser.AST.UserDefinedLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -33365,7 +33418,7 @@ public CXXUuidofExpr(global::CppSharp.Parser.AST.CXXUuidofExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34171,7 +34224,7 @@ public CXXConstructExpr(global::CppSharp.Parser.AST.CXXConstructExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34713,7 +34766,7 @@ public CXXTemporaryObjectExpr(global::CppSharp.Parser.AST.CXXTemporaryObjectExpr partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34849,7 +34902,7 @@ public LambdaExpr(global::CppSharp.Parser.AST.LambdaExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -35255,7 +35308,7 @@ public CXXNewExpr(global::CppSharp.Parser.AST.CXXNewExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -36397,12 +36450,12 @@ public FindResult(global::CppSharp.Parser.AST.OverloadExpr.FindResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -37154,7 +37207,7 @@ public CXXUnresolvedConstructExpr(global::CppSharp.Parser.AST.CXXUnresolvedConst partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -38662,12 +38715,12 @@ public ExtraState(global::CppSharp.Parser.AST.MaterializeTemporaryExpr.ExtraStat public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -39754,12 +39807,12 @@ public ParserTargetInfo(global::CppSharp.Parser.ParserTargetInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -40640,12 +40693,12 @@ public CppParserOptions(global::CppSharp.Parser.CppParserOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41181,12 +41234,12 @@ public CppLinkerOptions(global::CppSharp.Parser.CppLinkerOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41380,12 +41433,12 @@ public ParserDiagnostic(global::CppSharp.Parser.ParserDiagnostic _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41594,12 +41647,12 @@ public ParserResult(global::CppSharp.Parser.ParserResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41805,12 +41858,12 @@ public ClangParser(global::CppSharp.Parser.ClangParser _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs index 086462296a..3f7910977c 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs @@ -16,6 +16,7 @@ [assembly:InternalsVisibleTo("CppSharp.CppParser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace Std { @@ -147,12 +148,12 @@ public Allocator() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -280,12 +281,12 @@ protected CharTraits(void* native, bool skipVTables = false) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -485,12 +486,12 @@ public BasicString() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs index 5c0c7a9d4d..93855910f0 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs @@ -14,6 +14,7 @@ [assembly:InternalsVisibleTo("CppSharp.Parser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace CppSharp { @@ -187,12 +188,12 @@ public NativeLibrary(global::CppSharp.Parser.AST.NativeLibrary _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -378,12 +379,12 @@ public Comment(global::CppSharp.Parser.AST.Comment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -602,7 +603,7 @@ public FullComment(global::CppSharp.Parser.AST.FullComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -850,7 +851,7 @@ public ParagraphComment(global::CppSharp.Parser.AST.ParagraphComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1043,12 +1044,12 @@ public Argument(global::CppSharp.Parser.AST.BlockCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1151,7 +1152,7 @@ public BlockCommandComment(global::CppSharp.Parser.AST.BlockCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1323,7 +1324,7 @@ public ParamCommandComment(global::CppSharp.Parser.AST.ParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1462,7 +1463,7 @@ public TParamCommandComment(global::CppSharp.Parser.AST.TParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1589,7 +1590,7 @@ public VerbatimBlockLineComment(global::CppSharp.Parser.AST.VerbatimBlockLineCom partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1716,7 +1717,7 @@ public VerbatimBlockComment(global::CppSharp.Parser.AST.VerbatimBlockComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1847,7 +1848,7 @@ public VerbatimLineComment(global::CppSharp.Parser.AST.VerbatimLineComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2018,12 +2019,12 @@ public Argument(global::CppSharp.Parser.AST.InlineCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2117,7 +2118,7 @@ public InlineCommandComment(global::CppSharp.Parser.AST.InlineCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2416,12 +2417,12 @@ public Attribute(global::CppSharp.Parser.AST.HTMLStartTagComment.Attribute _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2529,7 +2530,7 @@ public HTMLStartTagComment(global::CppSharp.Parser.AST.HTMLStartTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2673,7 +2674,7 @@ public HTMLEndTagComment(global::CppSharp.Parser.AST.HTMLEndTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2786,7 +2787,7 @@ public TextComment(global::CppSharp.Parser.AST.TextComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2918,12 +2919,12 @@ public RawComment(global::CppSharp.Parser.AST.RawComment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3017,7 +3018,7 @@ public partial struct __Internal } private SourceLocation.__Internal __instance; - internal SourceLocation.__Internal __Instance => __instance; + internal ref SourceLocation.__Internal __Instance => ref __instance; internal static SourceLocation __CreateInstance(__IntPtr native, bool skipVTables = false) { @@ -3040,6 +3041,14 @@ private SourceLocation(void* native, bool skipVTables = false) : this() __instance = *(global::CppSharp.Parser.SourceLocation.__Internal*) native; } + public SourceLocation() + { + fixed (__Internal* __instancePtr = &__instance) + { + __Internal.ctor(new __IntPtr(__instancePtr)); + } + } + public SourceLocation(uint ID) : this() { @@ -3175,12 +3184,12 @@ public SourceRange() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3402,12 +3411,12 @@ public Type(global::CppSharp.Parser.AST.Type _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3543,12 +3552,12 @@ public TypeQualifiers() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3695,12 +3704,12 @@ public QualifiedType(global::CppSharp.Parser.AST.QualifiedType _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4082,7 +4091,7 @@ public FunctionType(global::CppSharp.Parser.AST.FunctionType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4826,12 +4835,12 @@ public TemplateArgument(global::CppSharp.Parser.AST.TemplateArgument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4997,7 +5006,7 @@ public TemplateSpecializationType(global::CppSharp.Parser.AST.TemplateSpecializa partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5167,7 +5176,7 @@ public DependentTemplateSpecializationType(global::CppSharp.Parser.AST.Dependent partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5313,7 +5322,7 @@ public TemplateParameterType(global::CppSharp.Parser.AST.TemplateParameterType _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5688,7 +5697,7 @@ public DependentNameType(global::CppSharp.Parser.AST.DependentNameType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -6392,9 +6401,10 @@ public enum CppAbi Itanium = 0, Microsoft = 1, ARM = 2, - iOS = 3, - iOS64 = 4, - WebAssembly = 5 + AArch64 = 3, + iOS = 4, + AppleARM64 = 5, + WebAssembly = 6 } public enum RecordArgABI @@ -6574,12 +6584,12 @@ public Declaration(global::CppSharp.Parser.AST.Declaration _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7147,7 +7157,7 @@ public DeclarationContext(global::CppSharp.Parser.AST.DeclarationContext _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7554,7 +7564,7 @@ public TypedefNameDecl(global::CppSharp.Parser.AST.TypedefNameDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7693,7 +7703,7 @@ public TypedefDecl(global::CppSharp.Parser.AST.TypedefDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7813,7 +7823,7 @@ public TypeAlias(global::CppSharp.Parser.AST.TypeAlias _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7946,7 +7956,7 @@ public Friend(global::CppSharp.Parser.AST.Friend _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8082,12 +8092,12 @@ public StatementObsolete(global::CppSharp.Parser.AST.StatementObsolete _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8232,7 +8242,7 @@ public ExpressionObsolete(global::CppSharp.Parser.AST.ExpressionObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8344,7 +8354,7 @@ public BinaryOperatorObsolete(global::CppSharp.Parser.AST.BinaryOperatorObsolete partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8503,7 +8513,7 @@ public CallExprObsolete(global::CppSharp.Parser.AST.CallExprObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8650,7 +8660,7 @@ public CXXConstructExprObsolete(global::CppSharp.Parser.AST.CXXConstructExprObso partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8804,7 +8814,7 @@ public Parameter(global::CppSharp.Parser.AST.Parameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9047,7 +9057,7 @@ public Function(global::CppSharp.Parser.AST.Function _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9507,7 +9517,7 @@ public Method(global::CppSharp.Parser.AST.Method _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9878,7 +9888,7 @@ public Item(global::CppSharp.Parser.AST.Enumeration.Item _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9985,7 +9995,7 @@ public Enumeration(global::CppSharp.Parser.AST.Enumeration _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10189,7 +10199,7 @@ public Variable(global::CppSharp.Parser.AST.Variable _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10357,12 +10367,12 @@ public BaseClassSpecifier(global::CppSharp.Parser.AST.BaseClassSpecifier _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10535,7 +10545,7 @@ public Field(global::CppSharp.Parser.AST.Field _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10708,7 +10718,7 @@ public AccessSpecifierDecl(global::CppSharp.Parser.AST.AccessSpecifierDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10819,12 +10829,12 @@ public VTableComponent(global::CppSharp.Parser.AST.VTableComponent _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10989,12 +10999,12 @@ public VTableLayout(global::CppSharp.Parser.AST.VTableLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11140,12 +11150,12 @@ public VFTableInfo(global::CppSharp.Parser.AST.VFTableInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11317,12 +11327,12 @@ public LayoutField(global::CppSharp.Parser.AST.LayoutField other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11493,12 +11503,12 @@ public LayoutBase(global::CppSharp.Parser.AST.LayoutBase other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11686,12 +11696,12 @@ public ClassLayout(global::CppSharp.Parser.AST.ClassLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12083,7 +12093,7 @@ public Class(global::CppSharp.Parser.AST.Class _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12504,7 +12514,7 @@ public Template(global::CppSharp.Parser.AST.Template _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12673,7 +12683,7 @@ public TypeAliasTemplate(global::CppSharp.Parser.AST.TypeAliasTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12794,7 +12804,7 @@ public TemplateParameter(global::CppSharp.Parser.AST.TemplateParameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12961,7 +12971,7 @@ public TemplateTemplateParameter(global::CppSharp.Parser.AST.TemplateTemplatePar partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13122,7 +13132,7 @@ public TypeTemplateParameter(global::CppSharp.Parser.AST.TypeTemplateParameter _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13264,7 +13274,7 @@ public NonTypeTemplateParameter(global::CppSharp.Parser.AST.NonTypeTemplateParam partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13485,7 +13495,7 @@ public ClassTemplate(global::CppSharp.Parser.AST.ClassTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13697,7 +13707,7 @@ public ClassTemplateSpecialization(global::CppSharp.Parser.AST.ClassTemplateSpec partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13769,7 +13779,7 @@ public uint ArgumentsCount public unsafe partial class ClassTemplatePartialSpecialization : global::CppSharp.Parser.AST.ClassTemplateSpecialization, IDisposable { - [StructLayout(LayoutKind.Sequential, Size = 656)] + [StructLayout(LayoutKind.Sequential, Size = 680)] public new partial struct __Internal { internal global::CppSharp.Parser.AST.DeclarationKind kind; @@ -13824,6 +13834,7 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar internal __IntPtr templatedDecl; internal global::Std.Vector.__Internal Arguments; internal global::CppSharp.Parser.AST.TemplateSpecializationKind specializationKind; + internal global::Std.Vector.__Internal Parameters; [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecializationC2Ev", CallingConvention = __CallingConvention.Cdecl)] internal static extern void ctor(__IntPtr __instance); @@ -13833,6 +13844,18 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecializationD2Ev", CallingConvention = __CallingConvention.Cdecl)] internal static extern void dtor(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization13getParametersEj", CallingConvention = __CallingConvention.Cdecl)] + internal static extern __IntPtr GetParameters(__IntPtr __instance, uint i); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization13addParametersERPNS1_11DeclarationE", CallingConvention = __CallingConvention.Cdecl)] + internal static extern void AddParameters(__IntPtr __instance, __IntPtr s); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization15clearParametersEv", CallingConvention = __CallingConvention.Cdecl)] + internal static extern void ClearParameters(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization18getParametersCountEv", CallingConvention = __CallingConvention.Cdecl)] + internal static extern uint GetParametersCount(__IntPtr __instance); } internal static new ClassTemplatePartialSpecialization __CreateInstance(__IntPtr native, bool skipVTables = false) @@ -13901,7 +13924,7 @@ public ClassTemplatePartialSpecialization(global::CppSharp.Parser.AST.ClassTempl partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13913,6 +13936,36 @@ internal protected override void Dispose(bool disposing, bool callNativeDtor ) Marshal.FreeHGlobal(__Instance); __Instance = IntPtr.Zero; } + + public global::CppSharp.Parser.AST.Declaration GetParameters(uint i) + { + var ___ret = __Internal.GetParameters(__Instance, i); + var __result0 = global::CppSharp.Parser.AST.Declaration.__GetOrCreateInstance(___ret, false); + return __result0; + } + + public void AddParameters(global::CppSharp.Parser.AST.Declaration s) + { + if (ReferenceEquals(s, null)) + throw new global::System.ArgumentNullException("s", "Cannot be null because it is a C++ reference (&)."); + var ____arg0 = s.__Instance; + var __arg0 = new __IntPtr(&____arg0); + __Internal.AddParameters(__Instance, __arg0); + } + + public void ClearParameters() + { + __Internal.ClearParameters(__Instance); + } + + public uint ParametersCount + { + get + { + var ___ret = __Internal.GetParametersCount(__Instance); + return ___ret; + } + } } public unsafe partial class FunctionTemplate : global::CppSharp.Parser.AST.Template, IDisposable @@ -14037,7 +14090,7 @@ public FunctionTemplate(global::CppSharp.Parser.AST.FunctionTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14208,12 +14261,12 @@ public FunctionTemplateSpecialization(global::CppSharp.Parser.AST.FunctionTempla public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14422,7 +14475,7 @@ public VarTemplate(global::CppSharp.Parser.AST.VarTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14611,7 +14664,7 @@ public VarTemplateSpecialization(global::CppSharp.Parser.AST.VarTemplateSpeciali partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14792,7 +14845,7 @@ public VarTemplatePartialSpecialization(global::CppSharp.Parser.AST.VarTemplateP partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14910,7 +14963,7 @@ public UnresolvedUsingTypename(global::CppSharp.Parser.AST.UnresolvedUsingTypena partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15040,7 +15093,7 @@ public Namespace(global::CppSharp.Parser.AST.Namespace _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15164,12 +15217,12 @@ public PreprocessedEntity(global::CppSharp.Parser.AST.PreprocessedEntity _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15309,7 +15362,7 @@ public MacroDefinition(global::CppSharp.Parser.AST.MacroDefinition _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15465,7 +15518,7 @@ public MacroExpansion(global::CppSharp.Parser.AST.MacroExpansion _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15652,7 +15705,7 @@ public TranslationUnit(global::CppSharp.Parser.AST.TranslationUnit _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15839,12 +15892,12 @@ public ASTContext(global::CppSharp.Parser.AST.ASTContext _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16147,12 +16200,12 @@ public Stmt(global::CppSharp.Parser.AST.Stmt _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16324,7 +16377,7 @@ public DeclStmt(global::CppSharp.Parser.AST.DeclStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16607,7 +16660,7 @@ public CompoundStmt(global::CppSharp.Parser.AST.CompoundStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -18965,7 +19018,7 @@ public AsmStmt(global::CppSharp.Parser.AST.AsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19276,12 +19329,12 @@ public AsmStringPiece(global::CppSharp.Parser.AST.GCCAsmStmt.AsmStringPiece _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19427,7 +19480,7 @@ public GCCAsmStmt(global::CppSharp.Parser.AST.GCCAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19553,7 +19606,7 @@ public MSAsmStmt(global::CppSharp.Parser.AST.MSAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20254,12 +20307,12 @@ public Capture(global::CppSharp.Parser.AST.CapturedStmt.Capture _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20415,7 +20468,7 @@ public CapturedStmt(global::CppSharp.Parser.AST.CapturedStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -21278,12 +21331,12 @@ public CtorArgs(global::CppSharp.Parser.AST.CoroutineBodyStmt.CtorArgs _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -22106,12 +22159,12 @@ public Classification(global::CppSharp.Parser.AST.Expr.Classification _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -23859,7 +23912,7 @@ public StringLiteral(global::CppSharp.Parser.AST.StringLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -25232,7 +25285,7 @@ public CallExpr(global::CppSharp.Parser.AST.CallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26538,7 +26591,7 @@ public BinaryOperator(global::CppSharp.Parser.AST.BinaryOperator _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26928,7 +26981,7 @@ public CompoundAssignOperator(global::CppSharp.Parser.AST.CompoundAssignOperator partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -28811,12 +28864,12 @@ public Designator(global::CppSharp.Parser.AST.DesignatedInitExpr.Designator _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29067,12 +29120,12 @@ public FieldDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.FieldDesig public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29177,12 +29230,12 @@ public ArrayOrRangeDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.Arr public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31345,7 +31398,7 @@ public CXXOperatorCallExpr(global::CppSharp.Parser.AST.CXXOperatorCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31522,7 +31575,7 @@ public CXXMemberCallExpr(global::CppSharp.Parser.AST.CXXMemberCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31674,7 +31727,7 @@ public CUDAKernelCallExpr(global::CppSharp.Parser.AST.CUDAKernelCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -32449,7 +32502,7 @@ public UserDefinedLiteral(global::CppSharp.Parser.AST.UserDefinedLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -33365,7 +33418,7 @@ public CXXUuidofExpr(global::CppSharp.Parser.AST.CXXUuidofExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34171,7 +34224,7 @@ public CXXConstructExpr(global::CppSharp.Parser.AST.CXXConstructExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34713,7 +34766,7 @@ public CXXTemporaryObjectExpr(global::CppSharp.Parser.AST.CXXTemporaryObjectExpr partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34849,7 +34902,7 @@ public LambdaExpr(global::CppSharp.Parser.AST.LambdaExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -35255,7 +35308,7 @@ public CXXNewExpr(global::CppSharp.Parser.AST.CXXNewExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -36397,12 +36450,12 @@ public FindResult(global::CppSharp.Parser.AST.OverloadExpr.FindResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -37154,7 +37207,7 @@ public CXXUnresolvedConstructExpr(global::CppSharp.Parser.AST.CXXUnresolvedConst partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -38662,12 +38715,12 @@ public ExtraState(global::CppSharp.Parser.AST.MaterializeTemporaryExpr.ExtraStat public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -39754,12 +39807,12 @@ public ParserTargetInfo(global::CppSharp.Parser.ParserTargetInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -40640,12 +40693,12 @@ public CppParserOptions(global::CppSharp.Parser.CppParserOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41181,12 +41234,12 @@ public CppLinkerOptions(global::CppSharp.Parser.CppLinkerOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41380,12 +41433,12 @@ public ParserDiagnostic(global::CppSharp.Parser.ParserDiagnostic _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41594,12 +41647,12 @@ public ParserResult(global::CppSharp.Parser.ParserResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41805,12 +41858,12 @@ public ClangParser(global::CppSharp.Parser.ClangParser _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std.cs index cdf0bbf78f..640bb868cd 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std.cs @@ -16,6 +16,7 @@ [assembly:InternalsVisibleTo("CppSharp.CppParser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace Std { @@ -113,12 +114,12 @@ public Allocator() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -305,12 +306,12 @@ protected CharTraits(void* native, bool skipVTables = false) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -457,12 +458,12 @@ public BasicString() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs index 58d27ea063..f9e3781732 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs @@ -14,6 +14,7 @@ [assembly:InternalsVisibleTo("CppSharp.Parser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace CppSharp { @@ -187,12 +188,12 @@ public NativeLibrary(global::CppSharp.Parser.AST.NativeLibrary _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -378,12 +379,12 @@ public Comment(global::CppSharp.Parser.AST.Comment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -602,7 +603,7 @@ public FullComment(global::CppSharp.Parser.AST.FullComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -850,7 +851,7 @@ public ParagraphComment(global::CppSharp.Parser.AST.ParagraphComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1043,12 +1044,12 @@ public Argument(global::CppSharp.Parser.AST.BlockCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1151,7 +1152,7 @@ public BlockCommandComment(global::CppSharp.Parser.AST.BlockCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1323,7 +1324,7 @@ public ParamCommandComment(global::CppSharp.Parser.AST.ParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1462,7 +1463,7 @@ public TParamCommandComment(global::CppSharp.Parser.AST.TParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1589,7 +1590,7 @@ public VerbatimBlockLineComment(global::CppSharp.Parser.AST.VerbatimBlockLineCom partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1716,7 +1717,7 @@ public VerbatimBlockComment(global::CppSharp.Parser.AST.VerbatimBlockComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1847,7 +1848,7 @@ public VerbatimLineComment(global::CppSharp.Parser.AST.VerbatimLineComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2018,12 +2019,12 @@ public Argument(global::CppSharp.Parser.AST.InlineCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2117,7 +2118,7 @@ public InlineCommandComment(global::CppSharp.Parser.AST.InlineCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2416,12 +2417,12 @@ public Attribute(global::CppSharp.Parser.AST.HTMLStartTagComment.Attribute _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2529,7 +2530,7 @@ public HTMLStartTagComment(global::CppSharp.Parser.AST.HTMLStartTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2673,7 +2674,7 @@ public HTMLEndTagComment(global::CppSharp.Parser.AST.HTMLEndTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2786,7 +2787,7 @@ public TextComment(global::CppSharp.Parser.AST.TextComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2918,12 +2919,12 @@ public RawComment(global::CppSharp.Parser.AST.RawComment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3017,7 +3018,7 @@ public partial struct __Internal } private SourceLocation.__Internal __instance; - internal SourceLocation.__Internal __Instance => __instance; + internal ref SourceLocation.__Internal __Instance => ref __instance; internal static SourceLocation __CreateInstance(__IntPtr native, bool skipVTables = false) { @@ -3040,6 +3041,14 @@ private SourceLocation(void* native, bool skipVTables = false) : this() __instance = *(global::CppSharp.Parser.SourceLocation.__Internal*) native; } + public SourceLocation() + { + fixed (__Internal* __instancePtr = &__instance) + { + __Internal.ctor(new __IntPtr(__instancePtr)); + } + } + public SourceLocation(uint ID) : this() { @@ -3175,12 +3184,12 @@ public SourceRange() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3402,12 +3411,12 @@ public Type(global::CppSharp.Parser.AST.Type _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3543,12 +3552,12 @@ public TypeQualifiers() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3695,12 +3704,12 @@ public QualifiedType(global::CppSharp.Parser.AST.QualifiedType _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4082,7 +4091,7 @@ public FunctionType(global::CppSharp.Parser.AST.FunctionType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4826,12 +4835,12 @@ public TemplateArgument(global::CppSharp.Parser.AST.TemplateArgument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4997,7 +5006,7 @@ public TemplateSpecializationType(global::CppSharp.Parser.AST.TemplateSpecializa partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5167,7 +5176,7 @@ public DependentTemplateSpecializationType(global::CppSharp.Parser.AST.Dependent partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5313,7 +5322,7 @@ public TemplateParameterType(global::CppSharp.Parser.AST.TemplateParameterType _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5688,7 +5697,7 @@ public DependentNameType(global::CppSharp.Parser.AST.DependentNameType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -6392,9 +6401,10 @@ public enum CppAbi Itanium = 0, Microsoft = 1, ARM = 2, - iOS = 3, - iOS64 = 4, - WebAssembly = 5 + AArch64 = 3, + iOS = 4, + AppleARM64 = 5, + WebAssembly = 6 } public enum RecordArgABI @@ -6574,12 +6584,12 @@ public Declaration(global::CppSharp.Parser.AST.Declaration _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7147,7 +7157,7 @@ public DeclarationContext(global::CppSharp.Parser.AST.DeclarationContext _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7554,7 +7564,7 @@ public TypedefNameDecl(global::CppSharp.Parser.AST.TypedefNameDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7693,7 +7703,7 @@ public TypedefDecl(global::CppSharp.Parser.AST.TypedefDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7813,7 +7823,7 @@ public TypeAlias(global::CppSharp.Parser.AST.TypeAlias _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7946,7 +7956,7 @@ public Friend(global::CppSharp.Parser.AST.Friend _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8082,12 +8092,12 @@ public StatementObsolete(global::CppSharp.Parser.AST.StatementObsolete _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8232,7 +8242,7 @@ public ExpressionObsolete(global::CppSharp.Parser.AST.ExpressionObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8344,7 +8354,7 @@ public BinaryOperatorObsolete(global::CppSharp.Parser.AST.BinaryOperatorObsolete partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8503,7 +8513,7 @@ public CallExprObsolete(global::CppSharp.Parser.AST.CallExprObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8650,7 +8660,7 @@ public CXXConstructExprObsolete(global::CppSharp.Parser.AST.CXXConstructExprObso partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8804,7 +8814,7 @@ public Parameter(global::CppSharp.Parser.AST.Parameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9047,7 +9057,7 @@ public Function(global::CppSharp.Parser.AST.Function _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9507,7 +9517,7 @@ public Method(global::CppSharp.Parser.AST.Method _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9878,7 +9888,7 @@ public Item(global::CppSharp.Parser.AST.Enumeration.Item _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9985,7 +9995,7 @@ public Enumeration(global::CppSharp.Parser.AST.Enumeration _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10189,7 +10199,7 @@ public Variable(global::CppSharp.Parser.AST.Variable _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10357,12 +10367,12 @@ public BaseClassSpecifier(global::CppSharp.Parser.AST.BaseClassSpecifier _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10535,7 +10545,7 @@ public Field(global::CppSharp.Parser.AST.Field _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10708,7 +10718,7 @@ public AccessSpecifierDecl(global::CppSharp.Parser.AST.AccessSpecifierDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10819,12 +10829,12 @@ public VTableComponent(global::CppSharp.Parser.AST.VTableComponent _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10989,12 +10999,12 @@ public VTableLayout(global::CppSharp.Parser.AST.VTableLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11140,12 +11150,12 @@ public VFTableInfo(global::CppSharp.Parser.AST.VFTableInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11317,12 +11327,12 @@ public LayoutField(global::CppSharp.Parser.AST.LayoutField other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11493,12 +11503,12 @@ public LayoutBase(global::CppSharp.Parser.AST.LayoutBase other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11686,12 +11696,12 @@ public ClassLayout(global::CppSharp.Parser.AST.ClassLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12083,7 +12093,7 @@ public Class(global::CppSharp.Parser.AST.Class _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12504,7 +12514,7 @@ public Template(global::CppSharp.Parser.AST.Template _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12673,7 +12683,7 @@ public TypeAliasTemplate(global::CppSharp.Parser.AST.TypeAliasTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12794,7 +12804,7 @@ public TemplateParameter(global::CppSharp.Parser.AST.TemplateParameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12961,7 +12971,7 @@ public TemplateTemplateParameter(global::CppSharp.Parser.AST.TemplateTemplatePar partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13122,7 +13132,7 @@ public TypeTemplateParameter(global::CppSharp.Parser.AST.TypeTemplateParameter _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13264,7 +13274,7 @@ public NonTypeTemplateParameter(global::CppSharp.Parser.AST.NonTypeTemplateParam partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13485,7 +13495,7 @@ public ClassTemplate(global::CppSharp.Parser.AST.ClassTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13697,7 +13707,7 @@ public ClassTemplateSpecialization(global::CppSharp.Parser.AST.ClassTemplateSpec partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13769,7 +13779,7 @@ public uint ArgumentsCount public unsafe partial class ClassTemplatePartialSpecialization : global::CppSharp.Parser.AST.ClassTemplateSpecialization, IDisposable { - [StructLayout(LayoutKind.Sequential, Size = 584)] + [StructLayout(LayoutKind.Sequential, Size = 608)] public new partial struct __Internal { internal global::CppSharp.Parser.AST.DeclarationKind kind; @@ -13824,6 +13834,7 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar internal __IntPtr templatedDecl; internal global::Std.Vector.__Internal Arguments; internal global::CppSharp.Parser.AST.TemplateSpecializationKind specializationKind; + internal global::Std.Vector.__Internal Parameters; [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecializationC2Ev", CallingConvention = __CallingConvention.Cdecl)] internal static extern void ctor(__IntPtr __instance); @@ -13833,6 +13844,18 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecializationD2Ev", CallingConvention = __CallingConvention.Cdecl)] internal static extern void dtor(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization13getParametersEj", CallingConvention = __CallingConvention.Cdecl)] + internal static extern __IntPtr GetParameters(__IntPtr __instance, uint i); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization13addParametersERPNS1_11DeclarationE", CallingConvention = __CallingConvention.Cdecl)] + internal static extern void AddParameters(__IntPtr __instance, __IntPtr s); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization15clearParametersEv", CallingConvention = __CallingConvention.Cdecl)] + internal static extern void ClearParameters(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser", EntryPoint = "_ZN8CppSharp9CppParser3AST34ClassTemplatePartialSpecialization18getParametersCountEv", CallingConvention = __CallingConvention.Cdecl)] + internal static extern uint GetParametersCount(__IntPtr __instance); } internal static new ClassTemplatePartialSpecialization __CreateInstance(__IntPtr native, bool skipVTables = false) @@ -13901,7 +13924,7 @@ public ClassTemplatePartialSpecialization(global::CppSharp.Parser.AST.ClassTempl partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13913,6 +13936,36 @@ internal protected override void Dispose(bool disposing, bool callNativeDtor ) Marshal.FreeHGlobal(__Instance); __Instance = IntPtr.Zero; } + + public global::CppSharp.Parser.AST.Declaration GetParameters(uint i) + { + var ___ret = __Internal.GetParameters(__Instance, i); + var __result0 = global::CppSharp.Parser.AST.Declaration.__GetOrCreateInstance(___ret, false); + return __result0; + } + + public void AddParameters(global::CppSharp.Parser.AST.Declaration s) + { + if (ReferenceEquals(s, null)) + throw new global::System.ArgumentNullException("s", "Cannot be null because it is a C++ reference (&)."); + var ____arg0 = s.__Instance; + var __arg0 = new __IntPtr(&____arg0); + __Internal.AddParameters(__Instance, __arg0); + } + + public void ClearParameters() + { + __Internal.ClearParameters(__Instance); + } + + public uint ParametersCount + { + get + { + var ___ret = __Internal.GetParametersCount(__Instance); + return ___ret; + } + } } public unsafe partial class FunctionTemplate : global::CppSharp.Parser.AST.Template, IDisposable @@ -14037,7 +14090,7 @@ public FunctionTemplate(global::CppSharp.Parser.AST.FunctionTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14208,12 +14261,12 @@ public FunctionTemplateSpecialization(global::CppSharp.Parser.AST.FunctionTempla public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14422,7 +14475,7 @@ public VarTemplate(global::CppSharp.Parser.AST.VarTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14611,7 +14664,7 @@ public VarTemplateSpecialization(global::CppSharp.Parser.AST.VarTemplateSpeciali partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14792,7 +14845,7 @@ public VarTemplatePartialSpecialization(global::CppSharp.Parser.AST.VarTemplateP partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14910,7 +14963,7 @@ public UnresolvedUsingTypename(global::CppSharp.Parser.AST.UnresolvedUsingTypena partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15040,7 +15093,7 @@ public Namespace(global::CppSharp.Parser.AST.Namespace _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15164,12 +15217,12 @@ public PreprocessedEntity(global::CppSharp.Parser.AST.PreprocessedEntity _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15309,7 +15362,7 @@ public MacroDefinition(global::CppSharp.Parser.AST.MacroDefinition _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15465,7 +15518,7 @@ public MacroExpansion(global::CppSharp.Parser.AST.MacroExpansion _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15652,7 +15705,7 @@ public TranslationUnit(global::CppSharp.Parser.AST.TranslationUnit _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15839,12 +15892,12 @@ public ASTContext(global::CppSharp.Parser.AST.ASTContext _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16147,12 +16200,12 @@ public Stmt(global::CppSharp.Parser.AST.Stmt _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16324,7 +16377,7 @@ public DeclStmt(global::CppSharp.Parser.AST.DeclStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16607,7 +16660,7 @@ public CompoundStmt(global::CppSharp.Parser.AST.CompoundStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -18965,7 +19018,7 @@ public AsmStmt(global::CppSharp.Parser.AST.AsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19276,12 +19329,12 @@ public AsmStringPiece(global::CppSharp.Parser.AST.GCCAsmStmt.AsmStringPiece _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19427,7 +19480,7 @@ public GCCAsmStmt(global::CppSharp.Parser.AST.GCCAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19553,7 +19606,7 @@ public MSAsmStmt(global::CppSharp.Parser.AST.MSAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20254,12 +20307,12 @@ public Capture(global::CppSharp.Parser.AST.CapturedStmt.Capture _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20415,7 +20468,7 @@ public CapturedStmt(global::CppSharp.Parser.AST.CapturedStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -21278,12 +21331,12 @@ public CtorArgs(global::CppSharp.Parser.AST.CoroutineBodyStmt.CtorArgs _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -22106,12 +22159,12 @@ public Classification(global::CppSharp.Parser.AST.Expr.Classification _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -23859,7 +23912,7 @@ public StringLiteral(global::CppSharp.Parser.AST.StringLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -25232,7 +25285,7 @@ public CallExpr(global::CppSharp.Parser.AST.CallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26538,7 +26591,7 @@ public BinaryOperator(global::CppSharp.Parser.AST.BinaryOperator _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26928,7 +26981,7 @@ public CompoundAssignOperator(global::CppSharp.Parser.AST.CompoundAssignOperator partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -28811,12 +28864,12 @@ public Designator(global::CppSharp.Parser.AST.DesignatedInitExpr.Designator _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29067,12 +29120,12 @@ public FieldDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.FieldDesig public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29177,12 +29230,12 @@ public ArrayOrRangeDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.Arr public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31345,7 +31398,7 @@ public CXXOperatorCallExpr(global::CppSharp.Parser.AST.CXXOperatorCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31522,7 +31575,7 @@ public CXXMemberCallExpr(global::CppSharp.Parser.AST.CXXMemberCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31674,7 +31727,7 @@ public CUDAKernelCallExpr(global::CppSharp.Parser.AST.CUDAKernelCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -32449,7 +32502,7 @@ public UserDefinedLiteral(global::CppSharp.Parser.AST.UserDefinedLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -33365,7 +33418,7 @@ public CXXUuidofExpr(global::CppSharp.Parser.AST.CXXUuidofExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34171,7 +34224,7 @@ public CXXConstructExpr(global::CppSharp.Parser.AST.CXXConstructExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34713,7 +34766,7 @@ public CXXTemporaryObjectExpr(global::CppSharp.Parser.AST.CXXTemporaryObjectExpr partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34849,7 +34902,7 @@ public LambdaExpr(global::CppSharp.Parser.AST.LambdaExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -35255,7 +35308,7 @@ public CXXNewExpr(global::CppSharp.Parser.AST.CXXNewExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -36397,12 +36450,12 @@ public FindResult(global::CppSharp.Parser.AST.OverloadExpr.FindResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -37154,7 +37207,7 @@ public CXXUnresolvedConstructExpr(global::CppSharp.Parser.AST.CXXUnresolvedConst partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -38662,12 +38715,12 @@ public ExtraState(global::CppSharp.Parser.AST.MaterializeTemporaryExpr.ExtraStat public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -39754,12 +39807,12 @@ public ParserTargetInfo(global::CppSharp.Parser.ParserTargetInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -40640,12 +40693,12 @@ public CppParserOptions(global::CppSharp.Parser.CppParserOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41181,12 +41234,12 @@ public CppLinkerOptions(global::CppSharp.Parser.CppLinkerOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41380,12 +41433,12 @@ public ParserDiagnostic(global::CppSharp.Parser.ParserDiagnostic _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41594,12 +41647,12 @@ public ParserResult(global::CppSharp.Parser.ParserResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41805,12 +41858,12 @@ public ClangParser(global::CppSharp.Parser.ClangParser _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std.cs b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std.cs index 91785e9fdf..55496aa49f 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std.cs @@ -16,6 +16,7 @@ [assembly:InternalsVisibleTo("CppSharp.CppParser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace Std { @@ -113,12 +114,12 @@ public Allocator() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -305,12 +306,12 @@ protected CharTraits(void* native, bool skipVTables = false) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -433,12 +434,12 @@ public BasicString() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs index e8e7233f1d..fde849036a 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs @@ -14,6 +14,7 @@ [assembly:InternalsVisibleTo("CppSharp.Parser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace CppSharp { @@ -187,12 +188,12 @@ public NativeLibrary(global::CppSharp.Parser.AST.NativeLibrary _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -378,12 +379,12 @@ public Comment(global::CppSharp.Parser.AST.Comment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -602,7 +603,7 @@ public FullComment(global::CppSharp.Parser.AST.FullComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -850,7 +851,7 @@ public ParagraphComment(global::CppSharp.Parser.AST.ParagraphComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1043,12 +1044,12 @@ public Argument(global::CppSharp.Parser.AST.BlockCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1151,7 +1152,7 @@ public BlockCommandComment(global::CppSharp.Parser.AST.BlockCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1323,7 +1324,7 @@ public ParamCommandComment(global::CppSharp.Parser.AST.ParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1462,7 +1463,7 @@ public TParamCommandComment(global::CppSharp.Parser.AST.TParamCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1589,7 +1590,7 @@ public VerbatimBlockLineComment(global::CppSharp.Parser.AST.VerbatimBlockLineCom partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1716,7 +1717,7 @@ public VerbatimBlockComment(global::CppSharp.Parser.AST.VerbatimBlockComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -1847,7 +1848,7 @@ public VerbatimLineComment(global::CppSharp.Parser.AST.VerbatimLineComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2018,12 +2019,12 @@ public Argument(global::CppSharp.Parser.AST.InlineCommandComment.Argument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2117,7 +2118,7 @@ public InlineCommandComment(global::CppSharp.Parser.AST.InlineCommandComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2416,12 +2417,12 @@ public Attribute(global::CppSharp.Parser.AST.HTMLStartTagComment.Attribute _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2529,7 +2530,7 @@ public HTMLStartTagComment(global::CppSharp.Parser.AST.HTMLStartTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2673,7 +2674,7 @@ public HTMLEndTagComment(global::CppSharp.Parser.AST.HTMLEndTagComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2786,7 +2787,7 @@ public TextComment(global::CppSharp.Parser.AST.TextComment _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -2918,12 +2919,12 @@ public RawComment(global::CppSharp.Parser.AST.RawComment _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3017,7 +3018,7 @@ public partial struct __Internal } private SourceLocation.__Internal __instance; - internal SourceLocation.__Internal __Instance => __instance; + internal ref SourceLocation.__Internal __Instance => ref __instance; internal static SourceLocation __CreateInstance(__IntPtr native, bool skipVTables = false) { @@ -3040,6 +3041,14 @@ private SourceLocation(void* native, bool skipVTables = false) : this() __instance = *(global::CppSharp.Parser.SourceLocation.__Internal*) native; } + public SourceLocation() + { + fixed (__Internal* __instancePtr = &__instance) + { + __Internal.ctor(new __IntPtr(__instancePtr)); + } + } + public SourceLocation(uint ID) : this() { @@ -3175,12 +3184,12 @@ public SourceRange() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3402,12 +3411,12 @@ public Type(global::CppSharp.Parser.AST.Type _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3543,12 +3552,12 @@ public TypeQualifiers() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -3695,12 +3704,12 @@ public QualifiedType(global::CppSharp.Parser.AST.QualifiedType _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4082,7 +4091,7 @@ public FunctionType(global::CppSharp.Parser.AST.FunctionType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4826,12 +4835,12 @@ public TemplateArgument(global::CppSharp.Parser.AST.TemplateArgument _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -4997,7 +5006,7 @@ public TemplateSpecializationType(global::CppSharp.Parser.AST.TemplateSpecializa partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5167,7 +5176,7 @@ public DependentTemplateSpecializationType(global::CppSharp.Parser.AST.Dependent partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5313,7 +5322,7 @@ public TemplateParameterType(global::CppSharp.Parser.AST.TemplateParameterType _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -5688,7 +5697,7 @@ public DependentNameType(global::CppSharp.Parser.AST.DependentNameType _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -6392,9 +6401,10 @@ public enum CppAbi Itanium = 0, Microsoft = 1, ARM = 2, - iOS = 3, - iOS64 = 4, - WebAssembly = 5 + AArch64 = 3, + iOS = 4, + AppleARM64 = 5, + WebAssembly = 6 } public enum RecordArgABI @@ -6574,12 +6584,12 @@ public Declaration(global::CppSharp.Parser.AST.Declaration _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7147,7 +7157,7 @@ public DeclarationContext(global::CppSharp.Parser.AST.DeclarationContext _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7554,7 +7564,7 @@ public TypedefNameDecl(global::CppSharp.Parser.AST.TypedefNameDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7693,7 +7703,7 @@ public TypedefDecl(global::CppSharp.Parser.AST.TypedefDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7813,7 +7823,7 @@ public TypeAlias(global::CppSharp.Parser.AST.TypeAlias _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -7946,7 +7956,7 @@ public Friend(global::CppSharp.Parser.AST.Friend _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8082,12 +8092,12 @@ public StatementObsolete(global::CppSharp.Parser.AST.StatementObsolete _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8232,7 +8242,7 @@ public ExpressionObsolete(global::CppSharp.Parser.AST.ExpressionObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8344,7 +8354,7 @@ public BinaryOperatorObsolete(global::CppSharp.Parser.AST.BinaryOperatorObsolete partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8503,7 +8513,7 @@ public CallExprObsolete(global::CppSharp.Parser.AST.CallExprObsolete _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8650,7 +8660,7 @@ public CXXConstructExprObsolete(global::CppSharp.Parser.AST.CXXConstructExprObso partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -8804,7 +8814,7 @@ public Parameter(global::CppSharp.Parser.AST.Parameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9047,7 +9057,7 @@ public Function(global::CppSharp.Parser.AST.Function _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9507,7 +9517,7 @@ public Method(global::CppSharp.Parser.AST.Method _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9879,7 +9889,7 @@ public Item(global::CppSharp.Parser.AST.Enumeration.Item _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -9986,7 +9996,7 @@ public Enumeration(global::CppSharp.Parser.AST.Enumeration _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10190,7 +10200,7 @@ public Variable(global::CppSharp.Parser.AST.Variable _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10358,12 +10368,12 @@ public BaseClassSpecifier(global::CppSharp.Parser.AST.BaseClassSpecifier _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10536,7 +10546,7 @@ public Field(global::CppSharp.Parser.AST.Field _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10709,7 +10719,7 @@ public AccessSpecifierDecl(global::CppSharp.Parser.AST.AccessSpecifierDecl _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10820,12 +10830,12 @@ public VTableComponent(global::CppSharp.Parser.AST.VTableComponent _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -10990,12 +11000,12 @@ public VTableLayout(global::CppSharp.Parser.AST.VTableLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11142,12 +11152,12 @@ public VFTableInfo(global::CppSharp.Parser.AST.VFTableInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11319,12 +11329,12 @@ public LayoutField(global::CppSharp.Parser.AST.LayoutField other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11495,12 +11505,12 @@ public LayoutBase(global::CppSharp.Parser.AST.LayoutBase other) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -11688,12 +11698,12 @@ public ClassLayout(global::CppSharp.Parser.AST.ClassLayout _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12085,7 +12095,7 @@ public Class(global::CppSharp.Parser.AST.Class _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12506,7 +12516,7 @@ public Template(global::CppSharp.Parser.AST.Template _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12675,7 +12685,7 @@ public TypeAliasTemplate(global::CppSharp.Parser.AST.TypeAliasTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12796,7 +12806,7 @@ public TemplateParameter(global::CppSharp.Parser.AST.TemplateParameter _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -12963,7 +12973,7 @@ public TemplateTemplateParameter(global::CppSharp.Parser.AST.TemplateTemplatePar partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13124,7 +13134,7 @@ public TypeTemplateParameter(global::CppSharp.Parser.AST.TypeTemplateParameter _ partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13266,7 +13276,7 @@ public NonTypeTemplateParameter(global::CppSharp.Parser.AST.NonTypeTemplateParam partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13487,7 +13497,7 @@ public ClassTemplate(global::CppSharp.Parser.AST.ClassTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13699,7 +13709,7 @@ public ClassTemplateSpecialization(global::CppSharp.Parser.AST.ClassTemplateSpec partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13771,7 +13781,7 @@ public uint ArgumentsCount public unsafe partial class ClassTemplatePartialSpecialization : global::CppSharp.Parser.AST.ClassTemplateSpecialization, IDisposable { - [StructLayout(LayoutKind.Sequential, Size = 624)] + [StructLayout(LayoutKind.Sequential, Size = 648)] public new partial struct __Internal { internal global::CppSharp.Parser.AST.DeclarationKind kind; @@ -13826,6 +13836,7 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar internal __IntPtr templatedDecl; internal global::Std.Vector.__Internalc__N_std_S_vector____N_CppSharp_N_CppParser_N_AST_S_TemplateArgument___N_std_S_allocator__S0_ Arguments; internal global::CppSharp.Parser.AST.TemplateSpecializationKind specializationKind; + internal global::Std.Vector.__Internalc__N_std_S_vector_____N_CppSharp_N_CppParser_N_AST_S_Declaration___N_std_S_allocator__S0_ Parameters; [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "??0ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QEAA@XZ", CallingConvention = __CallingConvention.Cdecl)] internal static extern __IntPtr ctor(__IntPtr __instance); @@ -13835,6 +13846,18 @@ public unsafe partial class ClassTemplatePartialSpecialization : global::CppShar [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "??1ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QEAA@XZ", CallingConvention = __CallingConvention.Cdecl)] internal static extern void dtor(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "?getParameters@ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QEAAPEAVDeclaration@234@I@Z", CallingConvention = __CallingConvention.Cdecl)] + internal static extern __IntPtr GetParameters(__IntPtr __instance, uint i); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "?addParameters@ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QEAAXAEAPEAVDeclaration@234@@Z", CallingConvention = __CallingConvention.Cdecl)] + internal static extern void AddParameters(__IntPtr __instance, __IntPtr s); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "?clearParameters@ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QEAAXXZ", CallingConvention = __CallingConvention.Cdecl)] + internal static extern void ClearParameters(__IntPtr __instance); + + [SuppressUnmanagedCodeSecurity, DllImport("CppSharp.CppParser.dll", EntryPoint = "?getParametersCount@ClassTemplatePartialSpecialization@AST@CppParser@CppSharp@@QEAAIXZ", CallingConvention = __CallingConvention.Cdecl)] + internal static extern uint GetParametersCount(__IntPtr __instance); } internal static new ClassTemplatePartialSpecialization __CreateInstance(__IntPtr native, bool skipVTables = false) @@ -13903,7 +13926,7 @@ public ClassTemplatePartialSpecialization(global::CppSharp.Parser.AST.ClassTempl partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -13915,6 +13938,36 @@ internal protected override void Dispose(bool disposing, bool callNativeDtor ) Marshal.FreeHGlobal(__Instance); __Instance = IntPtr.Zero; } + + public global::CppSharp.Parser.AST.Declaration GetParameters(uint i) + { + var ___ret = __Internal.GetParameters(__Instance, i); + var __result0 = global::CppSharp.Parser.AST.Declaration.__GetOrCreateInstance(___ret, false); + return __result0; + } + + public void AddParameters(global::CppSharp.Parser.AST.Declaration s) + { + if (ReferenceEquals(s, null)) + throw new global::System.ArgumentNullException("s", "Cannot be null because it is a C++ reference (&)."); + var ____arg0 = s.__Instance; + var __arg0 = new __IntPtr(&____arg0); + __Internal.AddParameters(__Instance, __arg0); + } + + public void ClearParameters() + { + __Internal.ClearParameters(__Instance); + } + + public uint ParametersCount + { + get + { + var ___ret = __Internal.GetParametersCount(__Instance); + return ___ret; + } + } } public unsafe partial class FunctionTemplate : global::CppSharp.Parser.AST.Template, IDisposable @@ -14039,7 +14092,7 @@ public FunctionTemplate(global::CppSharp.Parser.AST.FunctionTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14210,12 +14263,12 @@ public FunctionTemplateSpecialization(global::CppSharp.Parser.AST.FunctionTempla public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14424,7 +14477,7 @@ public VarTemplate(global::CppSharp.Parser.AST.VarTemplate _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14613,7 +14666,7 @@ public VarTemplateSpecialization(global::CppSharp.Parser.AST.VarTemplateSpeciali partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14794,7 +14847,7 @@ public VarTemplatePartialSpecialization(global::CppSharp.Parser.AST.VarTemplateP partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -14912,7 +14965,7 @@ public UnresolvedUsingTypename(global::CppSharp.Parser.AST.UnresolvedUsingTypena partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15043,7 +15096,7 @@ public Namespace(global::CppSharp.Parser.AST.Namespace _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15167,12 +15220,12 @@ public PreprocessedEntity(global::CppSharp.Parser.AST.PreprocessedEntity _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15312,7 +15365,7 @@ public MacroDefinition(global::CppSharp.Parser.AST.MacroDefinition _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15468,7 +15521,7 @@ public MacroExpansion(global::CppSharp.Parser.AST.MacroExpansion _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15656,7 +15709,7 @@ public TranslationUnit(global::CppSharp.Parser.AST.TranslationUnit _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -15843,12 +15896,12 @@ public ASTContext(global::CppSharp.Parser.AST.ASTContext _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16151,12 +16204,12 @@ public Stmt(global::CppSharp.Parser.AST.Stmt _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16328,7 +16381,7 @@ public DeclStmt(global::CppSharp.Parser.AST.DeclStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -16611,7 +16664,7 @@ public CompoundStmt(global::CppSharp.Parser.AST.CompoundStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -18969,7 +19022,7 @@ public AsmStmt(global::CppSharp.Parser.AST.AsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19280,12 +19333,12 @@ public AsmStringPiece(global::CppSharp.Parser.AST.GCCAsmStmt.AsmStringPiece _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19431,7 +19484,7 @@ public GCCAsmStmt(global::CppSharp.Parser.AST.GCCAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -19557,7 +19610,7 @@ public MSAsmStmt(global::CppSharp.Parser.AST.MSAsmStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20258,12 +20311,12 @@ public Capture(global::CppSharp.Parser.AST.CapturedStmt.Capture _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -20419,7 +20472,7 @@ public CapturedStmt(global::CppSharp.Parser.AST.CapturedStmt _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -21282,12 +21335,12 @@ public CtorArgs(global::CppSharp.Parser.AST.CoroutineBodyStmt.CtorArgs _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -22110,12 +22163,12 @@ public Classification(global::CppSharp.Parser.AST.Expr.Classification _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -23869,7 +23922,7 @@ public StringLiteral(global::CppSharp.Parser.AST.StringLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -25246,7 +25299,7 @@ public CallExpr(global::CppSharp.Parser.AST.CallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26557,7 +26610,7 @@ public BinaryOperator(global::CppSharp.Parser.AST.BinaryOperator _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -26948,7 +27001,7 @@ public CompoundAssignOperator(global::CppSharp.Parser.AST.CompoundAssignOperator partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -28836,12 +28889,12 @@ public Designator(global::CppSharp.Parser.AST.DesignatedInitExpr.Designator _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29092,12 +29145,12 @@ public FieldDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.FieldDesig public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -29202,12 +29255,12 @@ public ArrayOrRangeDesignator(global::CppSharp.Parser.AST.DesignatedInitExpr.Arr public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31373,7 +31426,7 @@ public CXXOperatorCallExpr(global::CppSharp.Parser.AST.CXXOperatorCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31550,7 +31603,7 @@ public CXXMemberCallExpr(global::CppSharp.Parser.AST.CXXMemberCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -31702,7 +31755,7 @@ public CUDAKernelCallExpr(global::CppSharp.Parser.AST.CUDAKernelCallExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -32482,7 +32535,7 @@ public UserDefinedLiteral(global::CppSharp.Parser.AST.UserDefinedLiteral _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -33402,7 +33455,7 @@ public CXXUuidofExpr(global::CppSharp.Parser.AST.CXXUuidofExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34209,7 +34262,7 @@ public CXXConstructExpr(global::CppSharp.Parser.AST.CXXConstructExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34753,7 +34806,7 @@ public CXXTemporaryObjectExpr(global::CppSharp.Parser.AST.CXXTemporaryObjectExpr partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -34889,7 +34942,7 @@ public LambdaExpr(global::CppSharp.Parser.AST.LambdaExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -35296,7 +35349,7 @@ public CXXNewExpr(global::CppSharp.Parser.AST.CXXNewExpr _0) partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -36441,12 +36494,12 @@ public FindResult(global::CppSharp.Parser.AST.OverloadExpr.FindResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -37201,7 +37254,7 @@ public CXXUnresolvedConstructExpr(global::CppSharp.Parser.AST.CXXUnresolvedConst partial void DisposePartial(bool disposing); - internal protected override void Dispose(bool disposing, bool callNativeDtor ) + internal protected override void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -38716,12 +38769,12 @@ public ExtraState(global::CppSharp.Parser.AST.MaterializeTemporaryExpr.ExtraStat public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -39811,12 +39864,12 @@ public ParserTargetInfo(global::CppSharp.Parser.ParserTargetInfo _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -40697,12 +40750,12 @@ public CppParserOptions(global::CppSharp.Parser.CppParserOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41238,12 +41291,12 @@ public CppLinkerOptions(global::CppSharp.Parser.CppLinkerOptions _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41437,12 +41490,12 @@ public ParserDiagnostic(global::CppSharp.Parser.ParserDiagnostic _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41651,12 +41704,12 @@ public ParserResult(global::CppSharp.Parser.ParserResult _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -41862,12 +41915,12 @@ public ClangParser(global::CppSharp.Parser.ClangParser _0) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std.cs b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std.cs index 8a426d693e..a34a2d26e6 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std.cs +++ b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std.cs @@ -16,6 +16,7 @@ [assembly:InternalsVisibleTo("CppSharp.CppParser")] #pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required +#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference namespace Std { @@ -160,17 +161,26 @@ public Allocator() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; NativeToManagedMap.TryRemove(__Instance, out _); DisposePartial(disposing); + if (callNativeDtor) + { + var ___Ty = typeof(_Ty); + if (___Ty.IsAssignableFrom(typeof(sbyte))) + { + return; + } + throw new ArgumentOutOfRangeException("_Ty", string.Join(", ", new[] { typeof(_Ty).FullName }), "global::Std.Allocator<_Ty> maps a C++ template class and therefore it only supports a limited set of types and their subclasses: ."); + } if (__ownsNativeInstance) Marshal.FreeHGlobal(__Instance); __Instance = IntPtr.Zero; @@ -299,12 +309,12 @@ public BasicString() public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; @@ -431,12 +441,12 @@ protected CharTraits(void* native, bool skipVTables = false) public void Dispose() { - Dispose(disposing: true, callNativeDtor : __ownsNativeInstance ); + Dispose(disposing: true, callNativeDtor: __ownsNativeInstance); } partial void DisposePartial(bool disposing); - internal protected virtual void Dispose(bool disposing, bool callNativeDtor ) + internal protected virtual void Dispose(bool disposing, bool callNativeDtor) { if (__Instance == IntPtr.Zero) return; diff --git a/src/CppParser/Bootstrap/Bootstrap.cs b/src/CppParser/Bootstrap/Bootstrap.cs index 2e8b4d6394..a19db6c5fe 100644 --- a/src/CppParser/Bootstrap/Bootstrap.cs +++ b/src/CppParser/Bootstrap/Bootstrap.cs @@ -1778,8 +1778,7 @@ private static string CleanClangNamespaceFromName(string qualifiedName) return qualifiedName; } - public static string GetDeclName(Declaration decl, - GeneratorKind kind = GeneratorKind.CPlusPlus) + public static string GetDeclName(Declaration decl, GeneratorKind kind) { string name = decl.Name; @@ -1811,6 +1810,11 @@ public static string GetDeclName(Declaration decl, return name; } + public static string GetDeclName(Declaration decl) + { + return GetDeclName(decl, GeneratorKind.CPlusPlus); + } + public static AST.Type GetDeclType(AST.Type type, TypePrinter typePrinter) { diff --git a/src/CppParser/Decl.h b/src/CppParser/Decl.h index 40a2128bb0..99c972eb08 100644 --- a/src/CppParser/Decl.h +++ b/src/CppParser/Decl.h @@ -471,8 +471,9 @@ namespace CppSharp Itanium, Microsoft, ARM, + AArch64, iOS, - iOS64, + AppleARM64, WebAssembly }; @@ -715,6 +716,7 @@ namespace CppSharp public: ClassTemplatePartialSpecialization(); ~ClassTemplatePartialSpecialization(); + VECTOR(Declaration *, Parameters) }; class CS_API FunctionTemplate : public Template diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index 8821ae03ed..ac6fbf5de4 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -100,10 +100,12 @@ static CppAbi GetClassLayoutAbi(clang::TargetCXXABI::Kind abi) return CppAbi::Itanium; case clang::TargetCXXABI::GenericARM: return CppAbi::ARM; + case clang::TargetCXXABI::GenericAArch64: + return CppAbi::AArch64; case clang::TargetCXXABI::iOS: return CppAbi::iOS; case clang::TargetCXXABI::AppleARM64: - return CppAbi::iOS64; + return CppAbi::AppleARM64; case clang::TargetCXXABI::WebAssembly: return CppAbi::WebAssembly; default: @@ -231,9 +233,11 @@ ConvertToClangTargetCXXABI(CppSharp::CppParser::AST::CppAbi abi) return TargetCXXABI::Microsoft; case CppSharp::CppParser::AST::CppAbi::ARM: return TargetCXXABI::GenericARM; + case CppSharp::CppParser::AST::CppAbi::AArch64: + return TargetCXXABI::GenericAArch64; case CppSharp::CppParser::AST::CppAbi::iOS: return TargetCXXABI::iOS; - case CppSharp::CppParser::AST::CppAbi::iOS64: + case CppSharp::CppParser::AST::CppAbi::AppleARM64: return TargetCXXABI::AppleARM64; } @@ -727,7 +731,7 @@ void Parser::WalkVTable(const clang::CXXRecordDecl* RD, Class* C) } break; } - case TargetCXXABI::GenericItanium: + default: { ItaniumVTableContext VTContext(AST); @@ -735,8 +739,6 @@ void Parser::WalkVTable(const clang::CXXRecordDecl* RD, Class* C) C->layout->layout = WalkVTableLayout(VTLayout); break; } - default: - llvm_unreachable("Unsupported C++ ABI kind"); } } @@ -1339,6 +1341,8 @@ Parser::WalkClassTemplatePartialSpecialization(const clang::ClassTemplatePartial } } + TS->Parameters = WalkTemplateParameterList(CTS->getTemplateParameters()); + return TS; } @@ -4953,4 +4957,4 @@ Declaration* Parser::GetDeclarationFromFriend(clang::NamedDecl* FriendDecl) Decl->lineNumberEnd = MinLineNumberEnd; } return Decl; -} \ No newline at end of file +} diff --git a/src/CppParser/ParserGen/ParserGen.cs b/src/CppParser/ParserGen/ParserGen.cs index f068a71edd..48b0ab4af3 100644 --- a/src/CppParser/ParserGen/ParserGen.cs +++ b/src/CppParser/ParserGen/ParserGen.cs @@ -170,13 +170,17 @@ public static void Main(string[] args) var osxHeadersPath = Path.Combine(GetSourceDirectory("build"), @"headers\osx"); if (Directory.Exists(osxHeadersPath) || Platform.IsMacOS) { - Console.WriteLine("Generating the C# parser bindings for OSX..."); + Console.WriteLine("Generating the C# parser bindings for OSX x86..."); ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "i686-apple-darwin12.4.0")); Console.WriteLine(); - Console.WriteLine("Generating the C# parser bindings for OSX..."); + Console.WriteLine("Generating the C# parser bindings for OSX x64..."); ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "x86_64-apple-darwin12.4.0")); Console.WriteLine(); + + Console.WriteLine("Generating the C# parser bindings for OSX ARM64..."); + ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "arm64-apple-darwin12.4.0")); + Console.WriteLine(); } var linuxHeadersPath = Path.Combine(GetSourceDirectory("build"), @"headers\x86_64-linux-gnu"); @@ -186,10 +190,19 @@ public static void Main(string[] args) ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "x86_64-linux-gnu")); Console.WriteLine(); + Console.WriteLine("Generating the C# parser bindings for Linux ARM64..."); + ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "arm64-linux-gnu")); + Console.WriteLine(); + Console.WriteLine("Generating the C# parser bindings for Linux (GCC C++11 ABI)..."); ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "x86_64-linux-gnu", isGnuCpp11Abi: true)); Console.WriteLine(); + + Console.WriteLine("Generating the C# parser bindings for Linux ARM64 (GCC C++11 ABI)..."); + ConsoleDriver.Run(new ParserGen(GeneratorKind.CSharp, "arm64-linux-gnu", + isGnuCpp11Abi: true)); + Console.WriteLine(); } } } diff --git a/src/Generator.Tests/AST/TestAST.cs b/src/Generator.Tests/AST/TestAST.cs index b04a6f0c94..62a0f6d9f0 100644 --- a/src/Generator.Tests/AST/TestAST.cs +++ b/src/Generator.Tests/AST/TestAST.cs @@ -289,6 +289,28 @@ public void TestASTClassTemplates() Assert.AreSame(classTemplateSpecialization.TemplatedDecl.TemplatedClass, template.TemplatedClass); } + [Test] + public void TestASTClassTemplatePartialSpecialization() + { + var classTemplate = AstContext.TranslationUnits + .SelectMany(u => u.Templates.OfType()) + .FirstOrDefault(t => t.Name == "TestClassTemplatePartialSpecialization"); + + var classTemplatePartialSpecializations = classTemplate.Specializations.Where(specialization => specialization is ClassTemplatePartialSpecialization).Cast(); + Assert.IsTrue(classTemplatePartialSpecializations.Count() == 1); + var classTemplatePartialSpecialization = classTemplatePartialSpecializations.First(); + Assert.AreEqual(TemplateSpecializationKind.ExplicitSpecialization, classTemplatePartialSpecialization.SpecializationKind); + + var classTemplatePartialSpecializationParameters = classTemplatePartialSpecialization.Parameters; + Assert.AreEqual(1, classTemplatePartialSpecializationParameters.Count); + Assert.AreEqual((classTemplatePartialSpecializationParameters[0] as TypeTemplateParameter).Name, "K"); + + var classTemplatePartialSpecializationArguments = classTemplatePartialSpecialization.Arguments; + Assert.AreEqual(2, classTemplatePartialSpecializationArguments.Count); + Assert.AreEqual((classTemplatePartialSpecializationArguments[0].Type.Type as BuiltinType).Type, PrimitiveType.Int); + Assert.AreEqual((classTemplatePartialSpecializationArguments[1].Type.Type as TemplateParameterType).Parameter, classTemplatePartialSpecializationParameters[0]); + } + [Test] public void TestDeprecatedAttrs() { diff --git a/src/Generator/AST/Utils.cs b/src/Generator/AST/Utils.cs index e2814303e6..f74b2fb6a1 100644 --- a/src/Generator/AST/Utils.cs +++ b/src/Generator/AST/Utils.cs @@ -30,7 +30,7 @@ public static bool CheckIgnoreMethod(Method method) var isEmptyCtor = method.IsConstructor && method.Parameters.Count == 0; var @class = method.Namespace as Class; - if (@class != null && @class.IsValueType && isEmptyCtor) + if (@class != null && @class.IsValueType && isEmptyCtor && !@class.HasNonTrivialDefaultConstructor) return true; if (method.IsDestructor) @@ -208,7 +208,7 @@ public static bool IsMappedToPrimitive(ITypeMapDatabase typeMaps, Type type) return false; var typePrinterContext = new TypePrinterContext { Type = type }; - var mappedTo = typeMap.CSharpSignatureType(typePrinterContext); + var mappedTo = typeMap.SignatureType(typePrinterContext); mappedTo = mappedTo.Desugar(); mappedTo = (mappedTo.GetFinalPointee() ?? mappedTo).Desugar(); return (mappedTo.IsPrimitiveType() || diff --git a/src/Generator/AST/VTables.cs b/src/Generator/AST/VTables.cs index 93e59ed9dc..59bc2909cd 100644 --- a/src/Generator/AST/VTables.cs +++ b/src/Generator/AST/VTables.cs @@ -15,6 +15,7 @@ public static List GatherVTableMethodEntries(Class @class) case CppAbi.Microsoft: return GatherVTableMethodsMS(@class); case CppAbi.Itanium: + default: return GatherVTableMethodsItanium(@class); } diff --git a/src/Generator/BindingContext.cs b/src/Generator/BindingContext.cs index e7c094c692..cf0cbd3e41 100644 --- a/src/Generator/BindingContext.cs +++ b/src/Generator/BindingContext.cs @@ -2,6 +2,7 @@ using CppSharp.Passes; using CppSharp.Types; using CppSharp.Parser; +using System.Collections.Generic; namespace CppSharp.Generators { @@ -36,14 +37,21 @@ public BindingContext(DriverOptions options, ParserOptions parserOptions = null) public void RunPasses() { + Dictionary passesByType = new Dictionary(); + int index = 0; TranslationUnitPasses.RunPasses(pass => { + int count = passesByType.GetValueOrDefault(pass.GetType(), 0); Diagnostics.Debug("Pass '{0}'", pass); Diagnostics.PushIndent(); + Options.TranslationUnitPassPreCallBack?.Invoke(pass, index, count); pass.Context = this; pass.VisitASTContext(ASTContext); + Options.TranslationUnitPassPostCallBack?.Invoke(pass, index, count); Diagnostics.PopIndent(); + passesByType[pass.GetType()] = count + 1; + index += 1; }); } } diff --git a/src/Generator/Driver.cs b/src/Generator/Driver.cs index 0751fa1c72..9b20843338 100644 --- a/src/Generator/Driver.cs +++ b/src/Generator/Driver.cs @@ -4,12 +4,6 @@ using System.Linq; using CppSharp.AST; using CppSharp.Generators; -using CppSharp.Generators.C; -using CppSharp.Generators.CLI; -using CppSharp.Generators.Cpp; -using CppSharp.Generators.CSharp; -using CppSharp.Generators.Emscripten; -using CppSharp.Generators.TS; using CppSharp.Parser; using CppSharp.Passes; using CppSharp.Utils; @@ -32,31 +26,6 @@ public Driver(DriverOptions options) ParserOptions = new ParserOptions(); } - Generator CreateGeneratorFromKind(GeneratorKind kind) - { - switch (kind) - { - case GeneratorKind.C: - return new CGenerator(Context); - case GeneratorKind.CPlusPlus: - return new CppGenerator(Context); - case GeneratorKind.CLI: - return new CLIGenerator(Context); - case GeneratorKind.CSharp: - return new CSharpGenerator(Context); - case GeneratorKind.Emscripten: - return new EmscriptenGenerator(Context); - case GeneratorKind.QuickJS: - return new QuickJSGenerator(Context); - case GeneratorKind.NAPI: - return new NAPIGenerator(Context); - case GeneratorKind.TypeScript: - return new TSGenerator(Context); - } - - throw new NotImplementedException(); - } - void ValidateOptions() { if (!Options.Compilation.Platform.HasValue) @@ -87,7 +56,7 @@ public void Setup() ValidateOptions(); ParserOptions.Setup(Platform.Host); Context = new BindingContext(Options, ParserOptions); - Generator = CreateGeneratorFromKind(Options.GeneratorKind); + Generator = Options.GeneratorKind.CreateGenerator(Context); } public void SetupTypeMaps() => @@ -387,8 +356,7 @@ public bool CompileCode(Module module) out int error, out string errorMessage); if (error == 0) { - Diagnostics.Message($@"Compilation succeeded: { - LibraryMappings[module] = Path.Combine( + Diagnostics.Message($@"Compilation succeeded: {LibraryMappings[module] = Path.Combine( Options.OutputDir, $"{module.LibraryName}.dll")}."); return true; } diff --git a/src/Generator/Generator.cs b/src/Generator/Generator.cs index cf414b4823..42a8ba69a5 100644 --- a/src/Generator/Generator.cs +++ b/src/Generator/Generator.cs @@ -5,24 +5,6 @@ namespace CppSharp.Generators { - /// - /// Kinds of language generators. - /// - public enum GeneratorKind - { - CLI = 1, - CSharp = 2, - C, - CPlusPlus, - Emscripten, - ObjectiveC, - Java, - Swift, - QuickJS, - NAPI, - TypeScript - } - /// /// Output generated by each backend generator. /// @@ -46,9 +28,12 @@ public abstract class Generator : IDisposable { public BindingContext Context { get; } + protected readonly TypePrinter typePrinter; + protected Generator(BindingContext context) { Context = context; + typePrinter = Context.Options.GeneratorKind.CreateTypePrinter(context); CppSharp.AST.Type.TypePrinterDelegate += TypePrinterDelegate; } @@ -173,7 +158,10 @@ public virtual GeneratorOutput GenerateModule(Module module) return output; } - protected abstract string TypePrinterDelegate(CppSharp.AST.Type type); + protected virtual string TypePrinterDelegate(CppSharp.AST.Type type) + { + return type.Visit(typePrinter); + } public static string GeneratedIdentifier(string id) => $"__{(id.StartsWith("@") ? id.Substring(1) : id)}"; diff --git a/src/Generator/GeneratorKind.cs b/src/Generator/GeneratorKind.cs new file mode 100644 index 0000000000..4101a77cbd --- /dev/null +++ b/src/Generator/GeneratorKind.cs @@ -0,0 +1,170 @@ +using CppSharp.AST; +using CppSharp.Generators.C; +using CppSharp.Generators.CLI; +using CppSharp.Generators.Cpp; +using CppSharp.Generators.CSharp; +using CppSharp.Generators.Emscripten; +using CppSharp.Generators.TS; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace CppSharp.Generators +{ + /// + /// Kinds of language generators. + /// + public class GeneratorKind : IEquatable + { + public static readonly HashSet Registered = new(); + + public string ID { get; } + public string Name { get; } + public System.Type GeneratorType { get; } + public System.Type TypePrinterType { get; } + public string[] CLIOptions { get; } + + public GeneratorKind(string id, string name, System.Type generatorType, System.Type typePrinterType, string[] cLIOptions = null) + { + if (Registered.Any(kind => kind.ID == id)) + { + throw new Exception($"GeneratorKind has an already registered ID: {ID}"); + } + ID = id; + Name = name; + GeneratorType = generatorType; + TypePrinterType = typePrinterType; + CLIOptions = cLIOptions; + Registered.Add(this); + } + + public static GeneratorKind FindGeneratorKindByID(string id) + { + return Registered.Where(kind => kind.ID == id).First(); + } + + public Generator CreateGenerator(BindingContext context) + { + return (Generator)Activator.CreateInstance(GeneratorType, context); + } + + public TypePrinter CreateTypePrinter(BindingContext context) + { + return (TypePrinter)Activator.CreateInstance(TypePrinterType, context); + } + + public bool IsCLIOptionMatch(string cliOption) + { + if (CLIOptions == null) + { + return false; + } + return CLIOptions.Any(cliOption.Contains); + } + + public static bool operator ==(GeneratorKind obj1, GeneratorKind obj2) + { + if (ReferenceEquals(obj1, obj2)) + { + return true; + } + if (obj1 is null) + { + return false; + } + if (obj2 is null) + { + return false; + } + return obj1.Equals(obj2); + } + + public static bool operator !=(GeneratorKind obj1, GeneratorKind obj2) => !(obj1 == obj2); + + public bool Equals(GeneratorKind other) + { + if (other is null) + { + return false; + } + if (ReferenceEquals(this, other)) + { + return true; + } + return ID.Equals(other.ID); + } + + public override bool Equals(object obj) => Equals(obj as GeneratorKind); + + public override int GetHashCode() + { + unchecked + { + return ID.GetHashCode(); + } + } + + public override string ToString() + { + return ID; + } + + public const string CLI_ID = "CLI"; + public static readonly GeneratorKind CLI = new(CLI_ID, "C++/CLI", typeof(CLIGenerator), typeof(CLITypePrinter), new[] { "cli" }); + + public const string CSharp_ID = "CSharp"; + public static readonly GeneratorKind CSharp = new(CSharp_ID, "C#", typeof(CSharpGenerator), typeof(CSharpTypePrinter), new[] { "csharp" }); + + public const string C_ID = "C"; + public static readonly GeneratorKind C = new(C_ID, "C", typeof(CGenerator), typeof(CppTypePrinter), new[] { "c" }); + + public const string CPlusPlus_ID = "CPlusPlus"; + public static readonly GeneratorKind CPlusPlus = new(CPlusPlus_ID, "CPlusPlus", typeof(CppGenerator), typeof(CppTypePrinter), new[] { "cpp" }); + + public const string Emscripten_ID = "Emscripten"; + public static readonly GeneratorKind Emscripten = new(Emscripten_ID, "Emscripten", typeof(EmscriptenGenerator), typeof(EmscriptenTypePrinter), new[] { "emscripten" }); + + public const string ObjectiveC_ID = "ObjectiveC"; + public static readonly GeneratorKind ObjectiveC = new(ObjectiveC_ID, "ObjectiveC", typeof(NotImplementedGenerator), typeof(NotImplementedTypePrinter)); + + public const string Java_ID = "Java"; + public static readonly GeneratorKind Java = new(Java_ID, "Java", typeof(NotImplementedGenerator), typeof(NotImplementedTypePrinter)); + + public const string Swift_ID = "Swift"; + public static readonly GeneratorKind Swift = new(Swift_ID, "Swift", typeof(NotImplementedGenerator), typeof(NotImplementedTypePrinter)); + + public const string QuickJS_ID = "QuickJS"; + public static readonly GeneratorKind QuickJS = new(QuickJS_ID, "QuickJS", typeof(QuickJSGenerator), typeof(QuickJSTypePrinter), new[] { "qjs" }); + + public const string NAPI_ID = "NAPI"; + public static readonly GeneratorKind NAPI = new(NAPI_ID, "N-API", typeof(NAPIGenerator), typeof(NAPITypePrinter), new[] { "napi" }); + + public const string TypeScript_ID = "TypeScript"; + public static readonly GeneratorKind TypeScript = new(TypeScript_ID, "TypeScript", typeof(TSGenerator), typeof(TSTypePrinter), new[] { "ts", "typescript" }); + } + + public class NotImplementedTypePrinter : TypePrinter + { + public NotImplementedTypePrinter(BindingContext context) : base(context) + { + } + } + + public class NotImplementedGenerator : Generator + { + public NotImplementedGenerator(BindingContext context) : base(context) + { + throw new NotImplementedException(); + } + + public override List Generate(IEnumerable units) + { + throw new NotImplementedException(); + } + + public override bool SetupPasses() + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Generator/Generators/C/CGenerator.cs b/src/Generator/Generators/C/CGenerator.cs index 60c1dc8184..07884929cf 100644 --- a/src/Generator/Generators/C/CGenerator.cs +++ b/src/Generator/Generators/C/CGenerator.cs @@ -10,11 +10,8 @@ namespace CppSharp.Generators.C /// public class CGenerator : Generator { - private readonly CppTypePrinter typePrinter; - public CGenerator(BindingContext context) : base(context) { - typePrinter = new CppTypePrinter(Context); } public override List Generate(IEnumerable units) @@ -31,10 +28,5 @@ public override List Generate(IEnumerable units) } public override bool SetupPasses() => true; - - protected override string TypePrinterDelegate(Type type) - { - return type.Visit(typePrinter).ToString(); - } } } diff --git a/src/Generator/Generators/C/CppGenerator.cs b/src/Generator/Generators/C/CppGenerator.cs index 73a2aa8dc9..f02de85fbc 100644 --- a/src/Generator/Generators/C/CppGenerator.cs +++ b/src/Generator/Generators/C/CppGenerator.cs @@ -11,11 +11,8 @@ namespace CppSharp.Generators.Cpp /// public class CppGenerator : CGenerator { - private readonly CppTypePrinter typePrinter; - public CppGenerator(BindingContext context) : base(context) { - typePrinter = new CppTypePrinter(Context); } public override List Generate(IEnumerable units) @@ -44,11 +41,6 @@ public static bool ShouldGenerateClassNativeInstanceField(Class @class) return @class.IsRefType && (!@class.HasBase || !@class.HasRefBase()); } - - protected override string TypePrinterDelegate(Type type) - { - return type.Visit(typePrinter).ToString(); - } } /// diff --git a/src/Generator/Generators/C/CppHeaders.cs b/src/Generator/Generators/C/CppHeaders.cs index eb87f4fd88..b39d6877d2 100644 --- a/src/Generator/Generators/C/CppHeaders.cs +++ b/src/Generator/Generators/C/CppHeaders.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using CppSharp.AST; using CppSharp.AST.Extensions; @@ -87,7 +88,8 @@ public void GenerateIncludeForwardRefs(TranslationUnit unit) if (typeRef.Include.TranslationUnit == unit) continue; - if (typeRef.Include.File == unit.FileName) + var filename = Context.Options.GenerateName != null ? $"{Context.Options.GenerateName(TranslationUnit)}{Path.GetExtension(TranslationUnit.FileName)}" : TranslationUnit.FileName; + if (typeRef.Include.File == filename) continue; var include = typeRef.Include; diff --git a/src/Generator/Generators/C/CppMarshal.cs b/src/Generator/Generators/C/CppMarshal.cs index e0425e9f17..d60a5d6564 100644 --- a/src/Generator/Generators/C/CppMarshal.cs +++ b/src/Generator/Generators/C/CppMarshal.cs @@ -25,7 +25,7 @@ public override bool VisitType(Type type, TypeQualifiers quals) TypeMap typeMap; if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CppMarshalToManaged(Context); + typeMap.MarshalToManaged(Context); return false; } @@ -173,7 +173,7 @@ public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) typeMap.DoesMarshalling) { typeMap.Type = typedef; - typeMap.CppMarshalToManaged(Context); + typeMap.MarshalToManaged(Context); return typeMap.IsValueType; } @@ -193,7 +193,7 @@ public override bool VisitTemplateSpecializationType(TemplateSpecializationType if (Context.Context.TypeMaps.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = template; - typeMap.CppMarshalToManaged(Context); + typeMap.MarshalToManaged(Context); return true; } @@ -341,7 +341,7 @@ public override bool VisitType(Type type, TypeQualifiers quals) TypeMap typeMap; if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CppMarshalToNative(Context); + typeMap.MarshalToNative(Context); return false; } @@ -478,7 +478,7 @@ public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) if (Context.Context.TypeMaps.FindTypeMap(decl.Type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CppMarshalToNative(Context); + typeMap.MarshalToNative(Context); return typeMap.IsValueType; } @@ -516,7 +516,7 @@ public override bool VisitTemplateSpecializationType(TemplateSpecializationType if (Context.Context.TypeMaps.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = template; - typeMap.CppMarshalToNative(Context); + typeMap.MarshalToNative(Context); return true; } @@ -563,7 +563,7 @@ private void MarshalRefClass(Class @class) if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CppMarshalToNative(Context); + typeMap.MarshalToNative(Context); return; } diff --git a/src/Generator/Generators/C/CppSources.cs b/src/Generator/Generators/C/CppSources.cs index a8e7a013b6..061809b4ca 100644 --- a/src/Generator/Generators/C/CppSources.cs +++ b/src/Generator/Generators/C/CppSources.cs @@ -64,7 +64,8 @@ public virtual void GenerateForwardReferenceHeaders(TranslationUnit unit) foreach (var typeRef in typeReferenceCollector.TypeReferences) { - if (typeRef.Include.File == unit.FileName) + var filename = Context.Options.GenerateName != null ? $"{Context.Options.GenerateName(TranslationUnit)}{Path.GetExtension(TranslationUnit.FileName)}" : TranslationUnit.FileName; + if (typeRef.Include.File == filename) continue; var include = typeRef.Include; diff --git a/src/Generator/Generators/C/CppTypePrinter.cs b/src/Generator/Generators/C/CppTypePrinter.cs index f289705f76..a8ea5caf56 100644 --- a/src/Generator/Generators/C/CppTypePrinter.cs +++ b/src/Generator/Generators/C/CppTypePrinter.cs @@ -28,18 +28,13 @@ public class CppTypePrinter : TypePrinter public TypePrintScopeKind MethodScopeKind = TypePrintScopeKind.Qualified; - public CppTypePrinter() : base(TypePrinterContextKind.Native) + public CppTypePrinter(BindingContext context) : base(context, TypePrinterContextKind.Native) { PrintFlavorKind = CppTypePrintFlavorKind.Cpp; PrintTypeQualifiers = true; PrintTypeModifiers = true; } - public CppTypePrinter(BindingContext context) : this() - { - Context = context; - } - public TypeMapDatabase TypeMapDatabase => Context.TypeMaps; public DriverOptions Options => Context.Options; @@ -73,7 +68,7 @@ public virtual bool FindTypeMap(CppSharp.AST.Type type, out TypePrinterResult re typePrinter.PushContext(ContextKind); typePrinter.PushScope(ScopeKind); - var typeName = typeMap.CppSignatureType(typePrinterContext).Visit(typePrinter); + var typeName = typeMap.SignatureType(typePrinterContext).Visit(typePrinter); result = new TypePrinterResult(typeName) { TypeMap = typeMap }; return true; diff --git a/src/Generator/Generators/CLI/CLIGenerator.cs b/src/Generator/Generators/CLI/CLIGenerator.cs index 716095ac74..b3f93eb827 100644 --- a/src/Generator/Generators/CLI/CLIGenerator.cs +++ b/src/Generator/Generators/CLI/CLIGenerator.cs @@ -10,11 +10,8 @@ namespace CppSharp.Generators.CLI /// public class CLIGenerator : Generator { - private readonly CppTypePrinter typePrinter; - public CLIGenerator(BindingContext context) : base(context) { - typePrinter = new CLITypePrinter(context); } public override List Generate(IEnumerable units) @@ -39,10 +36,5 @@ public static bool ShouldGenerateClassNativeField(Class @class) return @class.IsRefType && (!@class.NeedsBase || !@class.HasRefBase()); } - - protected override string TypePrinterDelegate(Type type) - { - return type.Visit(typePrinter).ToString(); - } } } \ No newline at end of file diff --git a/src/Generator/Generators/CLI/CLIHeaders.cs b/src/Generator/Generators/CLI/CLIHeaders.cs index 602ff98ab6..900e2a8a5e 100644 --- a/src/Generator/Generators/CLI/CLIHeaders.cs +++ b/src/Generator/Generators/CLI/CLIHeaders.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using CppSharp.AST; using CppSharp.AST.Extensions; @@ -61,7 +62,8 @@ public void GenerateIncludeForwardRefs() if (typeRef.Include.TranslationUnit == TranslationUnit) continue; - if (typeRef.Include.File == TranslationUnit.FileName) + var filename = Context.Options.GenerateName != null ? $"{Context.Options.GenerateName(TranslationUnit)}{Path.GetExtension(TranslationUnit.FileName)}" : TranslationUnit.FileName; + if (typeRef.Include.File == filename) continue; var include = typeRef.Include; @@ -219,7 +221,7 @@ public void GenerateFunctions(DeclarationContext decl) { PushBlock(BlockKind.FunctionsClass, decl); - WriteLine("public ref class {0}", TranslationUnit.FileNameWithoutExtension); + WriteLine("public ref class {0}", Options.GenerateFreeStandingFunctionsClassName(TranslationUnit)); WriteLine("{"); WriteLine("public:"); Indent(); @@ -798,7 +800,8 @@ public void GenerateFunction(Function function) public static bool FunctionIgnored(Function function) { return TypeIgnored(function.ReturnType.Type) || - function.Parameters.Any(param => TypeIgnored(param.Type)); + function.Parameters.Any(param => TypeIgnored(param.Type)) || + function is Method { IsConstructor: true, Parameters: { Count: 0 }, Namespace: Class { IsValueType: true } }; } public static bool TypeIgnored(CppSharp.AST.Type type) diff --git a/src/Generator/Generators/CLI/CLIMarshal.cs b/src/Generator/Generators/CLI/CLIMarshal.cs index c641651754..7e52b9bd25 100644 --- a/src/Generator/Generators/CLI/CLIMarshal.cs +++ b/src/Generator/Generators/CLI/CLIMarshal.cs @@ -22,7 +22,7 @@ public override bool VisitType(Type type, TypeQualifiers quals) TypeMap typeMap; if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CLIMarshalToManaged(Context); + typeMap.MarshalToManaged(Context); return false; } @@ -215,7 +215,7 @@ public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) typeMap.DoesMarshalling) { typeMap.Type = typedef; - typeMap.CLIMarshalToManaged(Context); + typeMap.MarshalToManaged(Context); return typeMap.IsValueType; } @@ -240,7 +240,7 @@ public override bool VisitTemplateSpecializationType(TemplateSpecializationType if (Context.Context.TypeMaps.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = template; - typeMap.CLIMarshalToManaged(Context); + typeMap.MarshalToManaged(Context); return true; } @@ -406,7 +406,7 @@ public override bool VisitType(Type type, TypeQualifiers quals) TypeMap typeMap; if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CLIMarshalToNative(Context); + typeMap.MarshalToNative(Context); return false; } @@ -605,7 +605,7 @@ public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) if (Context.Context.TypeMaps.FindTypeMap(decl.Type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CLIMarshalToNative(Context); + typeMap.MarshalToNative(Context); return typeMap.IsValueType; } @@ -641,7 +641,7 @@ public override bool VisitTemplateSpecializationType(TemplateSpecializationType if (Context.Context.TypeMaps.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = template; - typeMap.CLIMarshalToNative(Context); + typeMap.MarshalToNative(Context); return true; } @@ -688,7 +688,7 @@ private void MarshalRefClass(Class @class) if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CLIMarshalToNative(Context); + typeMap.MarshalToNative(Context); return; } diff --git a/src/Generator/Generators/CLI/CLISources.cs b/src/Generator/Generators/CLI/CLISources.cs index af55a4cd12..3a1b692bc3 100644 --- a/src/Generator/Generators/CLI/CLISources.cs +++ b/src/Generator/Generators/CLI/CLISources.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.IO; using System.Linq; using CppSharp.AST; using CppSharp.AST.Extensions; @@ -61,7 +62,8 @@ public void GenerateForwardReferenceHeaders() foreach (var typeRef in typeReferenceCollector.TypeReferences) { - if (typeRef.Include.File == TranslationUnit.FileName) + var filename = Context.Options.GenerateName != null ? $"{Context.Options.GenerateName(TranslationUnit)}{Path.GetExtension(TranslationUnit.FileName)}" : TranslationUnit.FileName; + if (typeRef.Include.File == filename) continue; var include = typeRef.Include; @@ -909,7 +911,7 @@ public void GenerateFunction(Function function, DeclarationContext @namespace) GenerateDeclarationCommon(function); var classSig = string.Format("{0}::{1}", QualifiedIdentifier(@namespace), - TranslationUnit.FileNameWithoutExtension); + Options.GenerateFreeStandingFunctionsClassName(TranslationUnit)); Write("{0} {1}::{2}(", function.ReturnType, classSig, function.Name); diff --git a/src/Generator/Generators/CLI/CLITypePrinter.cs b/src/Generator/Generators/CLI/CLITypePrinter.cs index 69077affe2..970130f5da 100644 --- a/src/Generator/Generators/CLI/CLITypePrinter.cs +++ b/src/Generator/Generators/CLI/CLITypePrinter.cs @@ -21,7 +21,7 @@ public override TypePrinterResult VisitTagType(TagType tag, TypeQualifiers quals if (TypeMapDatabase.FindTypeMap(tag, out typeMap)) { var typePrinterContext = new TypePrinterContext { Type = tag }; - return typeMap.CLISignatureType(typePrinterContext).ToString(); + return typeMap.SignatureType(typePrinterContext).ToString(); } Declaration decl = tag.Declaration; @@ -112,7 +112,7 @@ public override TypePrinterResult VisitPointerType(PointerType pointer, Type = pointer }; - return typeMap.CLISignatureType(typePrinterContext).Visit(this); + return typeMap.SignatureType(typePrinterContext).Visit(this); } var pointee = pointer.Pointee.Desugar(); @@ -217,7 +217,7 @@ public override TypePrinterResult VisitTypedefType(TypedefType typedef, { typeMap.Type = typedef; var typePrinterContext = new TypePrinterContext { Type = typedef }; - return typeMap.CLISignatureType(typePrinterContext).ToString(); + return typeMap.SignatureType(typePrinterContext).ToString(); } FunctionType func; @@ -241,7 +241,7 @@ public override TypePrinterResult VisitTemplateSpecializationType( if (TypeMapDatabase.FindTypeMap(template, out typeMap) && !typeMap.IsIgnored) { var typePrinterContext = new TypePrinterContext { Type = template }; - return typeMap.CLISignatureType(typePrinterContext).ToString(); + return typeMap.SignatureType(typePrinterContext).ToString(); } return decl.Name; @@ -329,7 +329,7 @@ public override TypePrinterResult VisitDeclaration(Declaration decl) var result = string.Join("::", names); var translationUnit = decl.Namespace as TranslationUnit; if (translationUnit != null && translationUnit.HasFunctions && - rootNamespace == translationUnit.FileNameWithoutExtension) + rootNamespace == Options.GenerateFreeStandingFunctionsClassName(translationUnit)) return "::" + result; return result; } diff --git a/src/Generator/Generators/CSharp/CSharpGenerator.cs b/src/Generator/Generators/CSharp/CSharpGenerator.cs index 5d6da4749b..611f3c6bdc 100644 --- a/src/Generator/Generators/CSharp/CSharpGenerator.cs +++ b/src/Generator/Generators/CSharp/CSharpGenerator.cs @@ -7,18 +7,15 @@ namespace CppSharp.Generators.CSharp { public class CSharpGenerator : Generator { - private readonly CSharpTypePrinter typePrinter; - public CSharpGenerator(BindingContext context) : base(context) { - typePrinter = new CSharpTypePrinter(context); } public override List Generate(IEnumerable units) { var outputs = new List(); - var gen = new CSharpSources(Context, units) { TypePrinter = typePrinter }; + var gen = new CSharpSources(Context, units) { TypePrinter = (CSharpTypePrinter)typePrinter }; outputs.Add(gen); return outputs; @@ -42,10 +39,5 @@ public override bool SetupPasses() return true; } - - protected override string TypePrinterDelegate(Type type) - { - return type.Visit(typePrinter); - } } } diff --git a/src/Generator/Generators/CSharp/CSharpMarshal.cs b/src/Generator/Generators/CSharp/CSharpMarshal.cs index ccb3be5bac..de1bbe498b 100644 --- a/src/Generator/Generators/CSharp/CSharpMarshal.cs +++ b/src/Generator/Generators/CSharp/CSharpMarshal.cs @@ -45,7 +45,7 @@ public override bool VisitType(Type type, TypeQualifiers quals) TypeMap typeMap; if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CSharpMarshalToManaged(Context); + typeMap.MarshalToManaged(Context); return false; } @@ -471,7 +471,7 @@ public override bool VisitType(Type type, TypeQualifiers quals) TypeMap typeMap; if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CSharpMarshalToNative(Context); + typeMap.MarshalToNative(Context); return false; } @@ -601,7 +601,7 @@ public override bool VisitPointerType(PointerType pointer, TypeQualifiers quals) if (Context.Context.Options.MarshalCharAsManagedChar && primitive == PrimitiveType.Char) { - Context.Return.Write($"({typePrinter.PrintNative(pointer)})"); + Context.Return.StringBuilder.Insert(0, $"({typePrinter.PrintNative(pointer)}) "); if (isConst) Context.Return.Write("&"); Context.Return.Write(param.Name); @@ -634,17 +634,25 @@ public override bool VisitPointerType(PointerType pointer, TypeQualifiers quals) { if (Context.Parameter.Usage == ParameterUsage.Out) { - var qualifiedIdentifier = (@class.OriginalClass ?? @class).Visit(typePrinter); - Context.Before.WriteLine("var {0} = new {1}.{2}();", - arg, qualifiedIdentifier, Helpers.InternalStruct); + Context.Before.WriteLine("fixed ({0}.{1}* {2} = &{3}.{4})", + Context.Parameter.QualifiedType, Helpers.InternalStruct, + arg, Context.Parameter.Name, Helpers.InstanceIdentifier); + Context.HasCodeBlock = true; + Context.Before.WriteOpenBraceAndIndent(); + Context.Return.Write($"new {typePrinter.IntPtrType}({arg})"); } else { - Context.Before.WriteLine("var {0} = {1}.{2};", - arg, Context.Parameter.Name, Helpers.InstanceIdentifier); + Context.Before.Write($"var {arg} = "); + if (pointer.Pointee.IsTemplateParameterType()) + Context.Before.Write($"(({Context.Parameter.Type}) (object) {Context.Parameter.Name})"); + else + Context.Before.Write(Context.Parameter.Name); + Context.Before.WriteLine($".{Helpers.InstanceIdentifier};"); + + Context.Return.Write($"new {typePrinter.IntPtrType}(&{arg})"); } - Context.Return.Write($"new {typePrinter.IntPtrType}(&{arg})"); return true; } @@ -847,7 +855,12 @@ private void MarshalRefClass(Class @class) private void MarshalValueClass() { - Context.Return.Write("{0}.{1}", Context.Parameter.Name, Helpers.InstanceIdentifier); + if (Context.Parameter.Type.IsTemplateParameterType()) + Context.Return.Write($"(({Context.Parameter.Type}) (object) {Context.Parameter.Name})"); + else + Context.Return.Write(Context.Parameter.Name); + + Context.Return.Write($".{Helpers.InstanceIdentifier}"); } public override bool VisitFieldDecl(Field field) diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index f116968037..eb52336d07 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -85,6 +85,7 @@ public override void Process() GenerateUsings(); WriteLine("#pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required"); + WriteLine("#pragma warning disable CS9084 // Struct member returns 'this' or other instance members by reference"); NewLine(); if (!string.IsNullOrEmpty(Module.OutputNamespace)) @@ -249,7 +250,7 @@ public virtual void GenerateNamespaceFunctionsAndVariables(DeclarationContext co if (!context.Functions.Any(f => f.IsGenerated) && !hasGlobalVariables) return; - var parentName = SafeIdentifier(context.TranslationUnit.FileNameWithoutExtension); + var parentName = SafeIdentifier(Context.Options.GenerateFreeStandingFunctionsClassName(context.TranslationUnit)); var isStruct = EnumerateClasses() .ToList() .FindAll(cls => cls.IsValueType && cls.Name == parentName && context.QualifiedLogicalName == cls.Namespace.QualifiedLogicalName) @@ -413,7 +414,7 @@ public override bool VisitClassDecl(Class @class) if (@class.IsValueType) { WriteLine($"private {@class.Name}.{Helpers.InternalStruct} {Helpers.InstanceField};"); - WriteLine($"internal {@class.Name}.{Helpers.InternalStruct} {Helpers.InstanceIdentifier} => {Helpers.InstanceField};"); + WriteLine($"internal ref {@class.Name}.{Helpers.InternalStruct} {Helpers.InstanceIdentifier} => ref {Helpers.InstanceField};"); } else { @@ -780,7 +781,7 @@ public override void GenerateClassSpecifier(Class @class) } } - if (@class.IsGenerated && isBindingGen && @class.IsRefType && !@class.IsOpaque) + if (@class.IsGenerated && isBindingGen && NeedsDispose(@class) && !@class.IsOpaque) { bases.Add("IDisposable"); } @@ -789,6 +790,12 @@ public override void GenerateClassSpecifier(Class @class) Write(" : {0}", string.Join(", ", bases)); } + private bool NeedsDispose(Class @class) + { + return @class.IsRefType || @class.IsValueType && + (@class.GetConstCharFieldProperties().Any() || @class.HasNonTrivialDestructor); + } + private bool CanUseSequentialLayout(Class @class) { if (@class.IsUnion || @class.HasUnionFields) @@ -2256,25 +2263,24 @@ public void GenerateClassConstructors(Class @class) GenerateMethod(ctor, @class); } - if (@class.IsRefType) - { - // We used to always call GenerateClassFinalizer here. However, the - // finalizer calls Dispose which is conditionally implemented below. - // Instead, generate the finalizer only if Dispose is also implemented. + // We used to always call GenerateClassFinalizer here. However, the + // finalizer calls Dispose which is conditionally implemented below. + // Instead, generate the finalizer only if Dispose is also implemented. - // ensure any virtual dtor in the chain is called - var dtor = @class.Destructors.FirstOrDefault(d => d.Access != AccessSpecifier.Private); - if (ShouldGenerateClassNativeField(@class) || - (dtor != null && (dtor.IsVirtual || @class.HasNonTrivialDestructor)) || - // virtual destructors in abstract classes may lack a pointer in the v-table - // so they have to be called by symbol; thus we need an explicit Dispose override - @class.IsAbstract) - if (!@class.IsOpaque) - { + // ensure any virtual dtor in the chain is called + var dtor = @class.Destructors.FirstOrDefault(d => d.Access != AccessSpecifier.Private); + if (ShouldGenerateClassNativeField(@class) || + (dtor != null && (dtor.IsVirtual || @class.HasNonTrivialDestructor)) || + // virtual destructors in abstract classes may lack a pointer in the v-table + // so they have to be called by symbol; thus we need an explicit Dispose override + @class.IsAbstract) + if (!@class.IsOpaque) + { + if (@class.IsRefType) GenerateClassFinalizer(@class); + if (NeedsDispose(@class)) GenerateDisposeMethods(@class); - } - } + } } private void GenerateClassFinalizer(Class @class) @@ -2283,19 +2289,23 @@ private void GenerateClassFinalizer(Class @class) return; using (PushWriteBlock(BlockKind.Finalizer, $"~{@class.Name}()", NewLineKind.BeforeNextBlock)) - WriteLine($"Dispose(false, callNativeDtor : {Helpers.OwnsNativeInstanceIdentifier} );"); + WriteLine($"Dispose(false, callNativeDtor: {Helpers.OwnsNativeInstanceIdentifier});"); } private void GenerateDisposeMethods(Class @class) { var hasBaseClass = @class.HasBaseClass && @class.BaseClass.IsRefType; + var hasDtorParam = @class.IsRefType; + // Generate the IDispose Dispose() method. if (!hasBaseClass) { using (PushWriteBlock(BlockKind.Method, "public void Dispose()", NewLineKind.BeforeNextBlock)) { - WriteLine($"Dispose(disposing: true, callNativeDtor : {Helpers.OwnsNativeInstanceIdentifier} );"); + WriteLine(hasDtorParam + ? $"Dispose(disposing: true, callNativeDtor: {Helpers.OwnsNativeInstanceIdentifier});" + : "Dispose(disposing: true);"); if (Options.GenerateFinalizerFor(@class)) WriteLine("GC.SuppressFinalize(this);"); } @@ -2309,7 +2319,10 @@ private void GenerateDisposeMethods(Class @class) // Generate Dispose(bool, bool) method var ext = !@class.IsValueType ? (hasBaseClass ? "override " : "virtual ") : string.Empty; - using var _ = PushWriteBlock(BlockKind.Method, $"internal protected {ext}void Dispose(bool disposing, bool callNativeDtor )", NewLineKind.BeforeNextBlock); + var protectionLevel = @class.IsValueType ? "private" : "internal protected"; + using var _ = PushWriteBlock(BlockKind.Method, + $"{protectionLevel} {ext}void Dispose(bool disposing{(hasDtorParam ? ", bool callNativeDtor" : "")})", + NewLineKind.BeforeNextBlock); if (@class.IsRefType) { @@ -2356,7 +2369,7 @@ private void GenerateDisposeMethods(Class @class) // instance from the NativeToManagedMap. Of course, this is somewhat half-hearted // since we can't/don't do this when there's no virtual dtor available to detour. // Anyway, we must be able to call the native dtor in this case even if we don't - /// own the underlying native instance. + // own the underlying native instance. // // 2. When we we pass a disposable object to a function "by value" then the callee // calls the dtor on the argument so our marshalling code must have a way from preventing @@ -2368,21 +2381,29 @@ private void GenerateDisposeMethods(Class @class) // } // // IDisposable.Dispose() and Object.Finalize() set callNativeDtor = Helpers.OwnsNativeInstanceIdentifier - WriteLine("if (callNativeDtor)"); - if (@class.IsDependent || dtor.IsVirtual) - WriteOpenBraceAndIndent(); - else - Indent(); + if (hasDtorParam) + { + WriteLine("if (callNativeDtor)"); + if (@class.IsDependent || dtor.IsVirtual) + WriteOpenBraceAndIndent(); + else + Indent(); + } + if (dtor.IsVirtual) this.GenerateMember(@class, c => GenerateDestructorCall( c is ClassTemplateSpecialization ? c.Methods.First(m => m.InstantiatedFrom == dtor) : dtor)); else this.GenerateMember(@class, c => GenerateMethodBody(c, dtor)); - if (@class.IsDependent || dtor.IsVirtual) - UnindentAndWriteCloseBrace(); - else - Unindent(); + + if (hasDtorParam) + { + if (@class.IsDependent || dtor.IsVirtual) + UnindentAndWriteCloseBrace(); + else + Unindent(); + } } } @@ -2390,19 +2411,37 @@ c is ClassTemplateSpecialization ? // referenced memory. Don't rely on testing if the field's IntPtr is IntPtr.Zero since // unmanaged memory isn't always initialized and/or a reference may be owned by the // native side. - // + + string ptr; + if (@class.IsValueType) + { + ptr = $"{Helpers.InstanceIdentifier}Ptr"; + WriteLine($"fixed ({Helpers.InternalStruct}* {ptr} = &{Helpers.InstanceIdentifier})"); + WriteOpenBraceAndIndent(); + } + else + { + ptr = $"(({Helpers.InternalStruct}*){Helpers.InstanceIdentifier})"; + } + foreach (var prop in @class.GetConstCharFieldProperties()) { string name = prop.Field.OriginalName; - var ptr = $"(({Helpers.InternalStruct}*){Helpers.InstanceIdentifier})->{name}"; WriteLine($"if (__{name}_OwnsNativeMemory)"); - WriteLineIndent($"Marshal.FreeHGlobal({ptr});"); + WriteLineIndent($"Marshal.FreeHGlobal({ptr}->{name});"); } - WriteLine("if ({0})", Helpers.OwnsNativeInstanceIdentifier); - WriteLineIndent("Marshal.FreeHGlobal({0});", Helpers.InstanceIdentifier); + if (@class.IsValueType) + { + UnindentAndWriteCloseBrace(); + } + else + { + WriteLine("if ({0})", Helpers.OwnsNativeInstanceIdentifier); + WriteLineIndent("Marshal.FreeHGlobal({0});", Helpers.InstanceIdentifier); - WriteLine("{0} = IntPtr.Zero;", Helpers.InstanceIdentifier); + WriteLine("{0} = IntPtr.Zero;", Helpers.InstanceIdentifier); + } } private bool GenerateDestructorCall(Method dtor) @@ -2757,7 +2796,7 @@ public void GenerateMethod(Method method, Class @class) if (hasBase && !@class.IsValueType) WriteLineIndent($": this({(method != null ? "(void*) null" : "native")})"); - if (@class.IsValueType) + if (@class.IsValueType && method.Parameters.Count > 0) WriteLineIndent(": this()"); } @@ -3199,7 +3238,7 @@ public void GenerateFunctionCall(string functionName, Function function, Type = indirectRetType.Type.Desugar() }; - WriteLine("{0} {1};", typeMap.CSharpSignatureType(typePrinterContext), + WriteLine("{0} {1};", typeMap.SignatureType(typePrinterContext), Helpers.ReturnIdentifier); } else diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index 7271179569..9b1b855353 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -21,15 +21,10 @@ public class CSharpTypePrinter : TypePrinter public bool PrintModuleOutputNamespace = true; - public CSharpTypePrinter() + public CSharpTypePrinter(BindingContext context) : base(context) { } - public CSharpTypePrinter(BindingContext context) - { - Context = context; - } - public string QualifiedType(string name) { return IsGlobalQualifiedScope ? $"global::{name}" : name; @@ -41,7 +36,7 @@ public override TypePrinterResult VisitTagType(TagType tag, TypeQualifiers quals return string.Empty; TypeMap typeMap; - if (TypeMapDatabase.FindTypeMap(tag, out typeMap)) + if (TypeMapDatabase.FindTypeMap(tag, GeneratorKind.CSharp, out typeMap)) { typeMap.Type = tag; @@ -52,7 +47,7 @@ public override TypePrinterResult VisitTagType(TagType tag, TypeQualifiers quals Type = tag }; - return typeMap.CSharpSignatureType(typePrinterContext).ToString(); + return typeMap.SignatureType(typePrinterContext).ToString(); } return base.VisitTagType(tag, quals); @@ -155,7 +150,7 @@ public override TypePrinterResult VisitArrayType(ArrayType array, public override TypePrinterResult VisitBuiltinType(BuiltinType builtin, TypeQualifiers quals) { TypeMap typeMap; - if (TypeMapDatabase.FindTypeMap(builtin, out typeMap)) + if (TypeMapDatabase.FindTypeMap(builtin, GeneratorKind.CSharp, out typeMap)) { var typePrinterContext = new TypePrinterContext() { @@ -164,7 +159,7 @@ public override TypePrinterResult VisitBuiltinType(BuiltinType builtin, TypeQual Type = builtin, Parameter = Parameter }; - return typeMap.CSharpSignatureType(typePrinterContext).Visit(this); + return typeMap.SignatureType(typePrinterContext).Visit(this); } return base.VisitBuiltinType(builtin, quals); } @@ -188,7 +183,7 @@ public override TypePrinterResult VisitPointerType(PointerType pointer, if (allowStrings && pointer.IsConstCharString()) { TypeMap typeMap; - TypeMapDatabase.FindTypeMap(pointer, out typeMap); + TypeMapDatabase.FindTypeMap(pointer, GeneratorKind.CSharp, out typeMap); var typePrinterContext = new TypePrinterContext() { Kind = ContextKind, @@ -196,7 +191,7 @@ public override TypePrinterResult VisitPointerType(PointerType pointer, Type = pointer.Pointee, Parameter = Parameter }; - return typeMap.CSharpSignatureType(typePrinterContext).Visit(this); + return typeMap.SignatureType(typePrinterContext).Visit(this); } var pointee = pointer.Pointee.Desugar(); @@ -263,7 +258,7 @@ public override TypePrinterResult VisitTypedefType(TypedefType typedef, var decl = typedef.Declaration; TypeMap typeMap; - if (TypeMapDatabase.FindTypeMap(typedef, out typeMap)) + if (TypeMapDatabase.FindTypeMap(typedef, GeneratorKind.CSharp, out typeMap)) { typeMap.Type = typedef; @@ -275,7 +270,7 @@ public override TypePrinterResult VisitTypedefType(TypedefType typedef, Parameter = Parameter }; - return typeMap.CSharpSignatureType(typePrinterContext).ToString(); + return typeMap.SignatureType(typePrinterContext).ToString(); } FunctionType func; @@ -304,7 +299,7 @@ public override TypePrinterResult VisitTemplateSpecializationType( template.Template.TemplatedDecl; TypeMap typeMap; - if (!TypeMapDatabase.FindTypeMap(template, out typeMap)) + if (!TypeMapDatabase.FindTypeMap(template, GeneratorKind.CSharp, out typeMap)) { if (ContextKind == TypePrinterContextKind.Managed && decl == template.Template.TemplatedDecl && @@ -335,7 +330,7 @@ public override TypePrinterResult VisitTemplateSpecializationType( MarshalKind = MarshalKind }; - return typeMap.CSharpSignatureType(typePrinterContext).ToString(); + return typeMap.SignatureType(typePrinterContext).ToString(); } public override TypePrinterResult VisitDependentTemplateSpecializationType( @@ -575,7 +570,7 @@ specialization.OriginalNamespace is Class && } if (decl is Variable && !(decl.Namespace is Class)) - names.Push(decl.TranslationUnit.FileNameWithoutExtension); + names.Push(Options.GenerateFreeStandingFunctionsClassName(decl.TranslationUnit)); while (!(ctx is TranslationUnit)) { diff --git a/src/Generator/Generators/ExtensionMethods.cs b/src/Generator/Generators/ExtensionMethods.cs index eb4d621a8e..c24a470381 100644 --- a/src/Generator/Generators/ExtensionMethods.cs +++ b/src/Generator/Generators/ExtensionMethods.cs @@ -63,12 +63,9 @@ public static Type GetMappedType(this Type type, TypeMapDatabase typeMaps, Type = typeMap.Type }; - switch (generatorKind) + if (generatorKind == GeneratorKind.CLI || generatorKind == GeneratorKind.CSharp) { - case GeneratorKind.CLI: - return typeMap.CLISignatureType(typePrinterContext).Desugar(); - case GeneratorKind.CSharp: - return typeMap.CSharpSignatureType(typePrinterContext).Desugar(); + return typeMap.SignatureType(typePrinterContext).Desugar(); } } diff --git a/src/Generator/Generators/Marshal.cs b/src/Generator/Generators/Marshal.cs index b1798fdbe4..1dcd9dced3 100644 --- a/src/Generator/Generators/Marshal.cs +++ b/src/Generator/Generators/Marshal.cs @@ -1,13 +1,13 @@ using CppSharp.AST; using CppSharp.Generators.C; +using System; namespace CppSharp.Generators { public class MarshalContext : TypePrinter { - public MarshalContext(BindingContext context, uint indentation) + public MarshalContext(BindingContext context, uint indentation) : base(context) { - Context = context; Before = new TextGenerator { CurrentIndentation = indentation }; Return = new TextGenerator { CurrentIndentation = indentation }; Cleanup = new TextGenerator { CurrentIndentation = indentation }; @@ -34,16 +34,16 @@ public MarshalContext(BindingContext context, uint indentation) public uint Indentation { get; } } - public abstract class MarshalPrinter : AstVisitor where C : MarshalContext where P : TypePrinter, new() + public abstract class MarshalPrinter : AstVisitor where C : MarshalContext where P : TypePrinter { public C Context { get; } protected MarshalPrinter(C ctx) { Context = ctx; - typePrinter.Context = ctx.Context; + typePrinter = (P)Activator.CreateInstance(typeof(P), ctx.Context); } - protected P typePrinter = new P(); + protected P typePrinter; } } diff --git a/src/Generator/Generators/NAPI/NAPIMarshal.cs b/src/Generator/Generators/NAPI/NAPIMarshal.cs index c0cf70082e..3eb23b528d 100644 --- a/src/Generator/Generators/NAPI/NAPIMarshal.cs +++ b/src/Generator/Generators/NAPI/NAPIMarshal.cs @@ -26,7 +26,7 @@ public override bool VisitType(Type type, TypeQualifiers quals) TypeMap typeMap; if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CppMarshalToManaged(Context); + typeMap.MarshalToManaged(Context); return false; } @@ -194,7 +194,7 @@ public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) typeMap.DoesMarshalling) { typeMap.Type = typedef; - typeMap.CppMarshalToManaged(Context); + typeMap.MarshalToManaged(Context); return typeMap.IsValueType; } @@ -214,7 +214,7 @@ public override bool VisitTemplateSpecializationType(TemplateSpecializationType if (Context.Context.TypeMaps.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = template; - typeMap.CppMarshalToManaged(Context); + typeMap.MarshalToManaged(Context); return true; } @@ -343,7 +343,7 @@ public override bool VisitType(Type type, TypeQualifiers quals) TypeMap typeMap; if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CppMarshalToNative(Context); + typeMap.MarshalToNative(Context); return false; } @@ -591,7 +591,7 @@ public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) if (Context.Context.TypeMaps.FindTypeMap(decl.Type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.CppMarshalToNative(Context); + typeMap.MarshalToNative(Context); return typeMap.IsValueType; } @@ -628,7 +628,7 @@ public override bool VisitTemplateSpecializationType(TemplateSpecializationType if (Context.Context.TypeMaps.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = template; - typeMap.CppMarshalToNative(Context); + typeMap.MarshalToNative(Context); return true; } diff --git a/src/Generator/Generators/NAPI/NAPITypePrinter.cs b/src/Generator/Generators/NAPI/NAPITypePrinter.cs new file mode 100644 index 0000000000..55109863b7 --- /dev/null +++ b/src/Generator/Generators/NAPI/NAPITypePrinter.cs @@ -0,0 +1,11 @@ +using CppSharp.Generators.C; + +namespace CppSharp.Generators.C +{ + public class NAPITypePrinter : CppTypePrinter + { + public NAPITypePrinter(BindingContext context) : base(context) + { + } + } +} diff --git a/src/Generator/Generators/QuickJS/QuickJSMarshal.cs b/src/Generator/Generators/QuickJS/QuickJSMarshal.cs index 5de2ad048a..4937192bfe 100644 --- a/src/Generator/Generators/QuickJS/QuickJSMarshal.cs +++ b/src/Generator/Generators/QuickJS/QuickJSMarshal.cs @@ -25,7 +25,7 @@ public override bool VisitType(Type type, TypeQualifiers quals) TypeMap typeMap; if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.MarshalToManaged(GeneratorKind.QuickJS, Context); + typeMap.MarshalToManaged(Context); return false; } @@ -210,7 +210,7 @@ public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) typeMap.DoesMarshalling) { typeMap.Type = typedef; - typeMap.MarshalToManaged(GeneratorKind.QuickJS, Context); + typeMap.MarshalToManaged(Context); return typeMap.IsValueType; } @@ -232,7 +232,7 @@ public override bool VisitTemplateSpecializationType(TemplateSpecializationType if (Context.Context.TypeMaps.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = template; - typeMap.MarshalToManaged(GeneratorKind.QuickJS, Context); + typeMap.MarshalToManaged(Context); return true; } @@ -385,7 +385,7 @@ public override bool VisitType(Type type, TypeQualifiers quals) TypeMap typeMap; if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.MarshalToNative(GeneratorKind.QuickJS, Context); + typeMap.MarshalToNative(Context); return false; } @@ -583,7 +583,7 @@ public override bool VisitTypedefType(TypedefType typedef, TypeQualifiers quals) if (Context.Context.TypeMaps.FindTypeMap(decl.Type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.MarshalToNative(GeneratorKind.QuickJS, Context); + typeMap.MarshalToNative(Context); return typeMap.IsValueType; } @@ -625,7 +625,7 @@ public override bool VisitTemplateSpecializationType(TemplateSpecializationType if (Context.Context.TypeMaps.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = template; - typeMap.MarshalToNative(GeneratorKind.QuickJS, Context); + typeMap.MarshalToNative(Context); return true; } @@ -672,7 +672,7 @@ private void MarshalRefClass(Class @class) if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { - typeMap.MarshalToNative(GeneratorKind.QuickJS, Context); + typeMap.MarshalToNative(Context); return; } diff --git a/src/Generator/Generators/TS/TSGenerator.cs b/src/Generator/Generators/TS/TSGenerator.cs index fa45267160..b4e3402c45 100644 --- a/src/Generator/Generators/TS/TSGenerator.cs +++ b/src/Generator/Generators/TS/TSGenerator.cs @@ -11,11 +11,8 @@ namespace CppSharp.Generators.TS /// public class TSGenerator : CGenerator { - private readonly TSTypePrinter typePrinter; - public TSGenerator(BindingContext context) : base(context) { - typePrinter = new TSTypePrinter(Context); } public override List Generate(IEnumerable units) @@ -32,10 +29,5 @@ public override bool SetupPasses() { return true; } - - protected override string TypePrinterDelegate(Type type) - { - return type.Visit(typePrinter).ToString(); - } } } diff --git a/src/Generator/Generators/TypePrinter.cs b/src/Generator/Generators/TypePrinter.cs index 806a719217..136b74d304 100644 --- a/src/Generator/Generators/TypePrinter.cs +++ b/src/Generator/Generators/TypePrinter.cs @@ -64,8 +64,9 @@ public class TypePrinter : ITypePrinter, public TypePrintScopeKind ScopeKind => scopeKinds.Peek(); public bool IsGlobalQualifiedScope => ScopeKind == TypePrintScopeKind.GlobalQualified; - public TypePrinter(TypePrinterContextKind contextKind = TypePrinterContextKind.Managed) + public TypePrinter(BindingContext context, TypePrinterContextKind contextKind = TypePrinterContextKind.Managed) { + Context = context; contexts = new Stack(); marshalKinds = new Stack(); scopeKinds = new Stack(); diff --git a/src/Generator/Options.cs b/src/Generator/Options.cs index df924b86f3..f42236cd67 100644 --- a/src/Generator/Options.cs +++ b/src/Generator/Options.cs @@ -5,6 +5,7 @@ using System.Text; using CppSharp.AST; using CppSharp.Generators; +using CppSharp.Passes; namespace CppSharp { @@ -172,6 +173,12 @@ public bool DoAllModulesHaveLibraries() => public string IncludePrefix; public Func GenerateName; + /// + /// By default the classes in which free standing functions are contained are named like the header they are in + /// this options allows you to customize this behavior. + /// + public Func GenerateFreeStandingFunctionsClassName = tu => tu.FileNameWithoutExtension; + /// /// Set this option to the kind of comments that you want generated /// in the source code. This overrides the default kind set by the @@ -248,6 +255,12 @@ public bool GenerateSingleCSharpFile /// public bool GenerateExternalDataFields { get; set; } = false; + public delegate void TranslationUnitPassCallBack(TranslationUnitPass pass, int index, int count); + + public TranslationUnitPassCallBack TranslationUnitPassPreCallBack { get; set; } + + public TranslationUnitPassCallBack TranslationUnitPassPostCallBack { get; set; } + #endregion } diff --git a/src/Generator/Passes/CheckDuplicatedNamesPass.cs b/src/Generator/Passes/CheckDuplicatedNamesPass.cs index 0a2d7622ab..13d4bc2f29 100644 --- a/src/Generator/Passes/CheckDuplicatedNamesPass.cs +++ b/src/Generator/Passes/CheckDuplicatedNamesPass.cs @@ -4,10 +4,6 @@ using CppSharp.AST; using CppSharp.AST.Extensions; using CppSharp.Generators; -using CppSharp.Generators.C; -using CppSharp.Generators.CLI; -using CppSharp.Generators.CSharp; -using CppSharp.Generators.Emscripten; using CppSharp.Types; namespace CppSharp.Passes @@ -190,43 +186,12 @@ public class CheckDuplicatedNamesPass : TranslationUnitPass public override bool VisitASTContext(ASTContext context) { - var typePrinter = GetTypePrinter(Options.GeneratorKind, Context); - DeclarationName.ParameterTypeComparer.TypePrinter = typePrinter; + DeclarationName.ParameterTypeComparer.TypePrinter = Options.GeneratorKind.CreateTypePrinter(Context); DeclarationName.ParameterTypeComparer.TypeMaps = Context.TypeMaps; DeclarationName.ParameterTypeComparer.GeneratorKind = Options.GeneratorKind; return base.VisitASTContext(context); } - private TypePrinter GetTypePrinter(GeneratorKind kind, BindingContext context) - { - TypePrinter typePrinter; - switch (kind) - { - case GeneratorKind.C: - typePrinter = new CppTypePrinter(Context) { PrintFlavorKind = CppTypePrintFlavorKind.C }; - break; - case GeneratorKind.Emscripten: - typePrinter = new EmscriptenTypePrinter(Context); - break;; - case GeneratorKind.CPlusPlus: - case GeneratorKind.QuickJS: - case GeneratorKind.NAPI: - case GeneratorKind.TypeScript: - typePrinter = new CppTypePrinter(Context); - break; - case GeneratorKind.CLI: - typePrinter = new CLITypePrinter(Context); - break; - case GeneratorKind.CSharp: - typePrinter = new CSharpTypePrinter(Context); - break; - default: - throw new System.NotImplementedException(); - } - - return typePrinter; - } - public override bool VisitProperty(Property decl) { if (!VisitDeclaration(decl)) diff --git a/src/Generator/Passes/ExpressionHelper.cs b/src/Generator/Passes/ExpressionHelper.cs index 435dbcf654..be5e924d7c 100644 --- a/src/Generator/Passes/ExpressionHelper.cs +++ b/src/Generator/Passes/ExpressionHelper.cs @@ -68,9 +68,9 @@ internal static class ExpressionHelper public static System.Type GetSystemType(BindingContext context, Type type) { - if (context.TypeMaps.FindTypeMap(type, out TypeMap typeMap)) + if (context.TypeMaps.FindTypeMap(type, GeneratorKind.CSharp, out TypeMap typeMap)) { - var cilType = typeMap.CSharpSignatureType(new TypePrinterContext { Type = type, Kind = TypePrinterContextKind.Managed }) as CILType; + var cilType = typeMap.SignatureType(new TypePrinterContext { Type = type, Kind = TypePrinterContextKind.Managed }) as CILType; if (cilType != null) return cilType.Type; } @@ -239,7 +239,7 @@ private static bool CheckForDefaultPointer(BindingContext context, Type desugare var typePrinterResult = type.Visit(typePrinter); TypeMap typeMap; - if (context.TypeMaps.FindTypeMap(type, out typeMap)) + if (context.TypeMaps.FindTypeMap(type, GeneratorKind.CSharp, out typeMap)) { var typePrinterContext = new TypePrinterContext() { @@ -248,7 +248,7 @@ private static bool CheckForDefaultPointer(BindingContext context, Type desugare Type = type }; - var typeInSignature = typeMap.CSharpSignatureType(typePrinterContext) + var typeInSignature = typeMap.SignatureType(typePrinterContext) .SkipPointerRefs().Desugar(); Enumeration @enum; @@ -413,7 +413,7 @@ private static bool CheckForChar(BindingContext context, Type desugared, ref str private static bool CheckForString(BindingContext context, Type desugared, ref string result) { - if (context.TypeMaps.FindTypeMap(desugared, out TypeMap typeMap)) + if (context.TypeMaps.FindTypeMap(desugared, GeneratorKind.CSharp, out TypeMap typeMap)) { var typePrinterContext = new TypePrinterContext() { @@ -422,7 +422,7 @@ private static bool CheckForString(BindingContext context, Type desugared, ref s Type = desugared }; - var typeInSignature = typeMap.CSharpSignatureType(typePrinterContext) + var typeInSignature = typeMap.SignatureType(typePrinterContext) .SkipPointerRefs().Desugar(); if (typeInSignature is CILType managed && managed.Type == typeof(string)) diff --git a/src/Generator/Passes/MoveFunctionToClassPass.cs b/src/Generator/Passes/MoveFunctionToClassPass.cs index 00a2ddc8d7..ebfe808ed7 100644 --- a/src/Generator/Passes/MoveFunctionToClassPass.cs +++ b/src/Generator/Passes/MoveFunctionToClassPass.cs @@ -57,7 +57,8 @@ private Class FindClassToMoveFunctionTo(Function function) } else { - string name = (function.Namespace as TranslationUnit)?.FileNameWithoutExtension ?? + var tu = function.Namespace as TranslationUnit; + string name = tu != null ? Options.GenerateFreeStandingFunctionsClassName(tu) : function.Namespace.Name; @class = ASTContext.FindClass( name, ignoreCase: true).FirstOrDefault( diff --git a/src/Generator/Passes/Pass.cs b/src/Generator/Passes/Pass.cs index 877a1116e2..3ea925528d 100644 --- a/src/Generator/Passes/Pass.cs +++ b/src/Generator/Passes/Pass.cs @@ -51,6 +51,16 @@ bool IsDeclExcluded(Declaration decl) } } + public class TranslationUnitPassGeneratorDependent : TranslationUnitPass + { + public Generator Generator { get; } + + public TranslationUnitPassGeneratorDependent(Generator generator) + { + Generator = generator; + } + } + /// /// Used to modify generated output. /// diff --git a/src/Generator/Passes/SpecializationMethodsWithDependentPointersPass.cs b/src/Generator/Passes/SpecializationMethodsWithDependentPointersPass.cs index 07ae0d79fd..a027390b43 100644 --- a/src/Generator/Passes/SpecializationMethodsWithDependentPointersPass.cs +++ b/src/Generator/Passes/SpecializationMethodsWithDependentPointersPass.cs @@ -52,6 +52,7 @@ public override bool VisitClassDecl(Class @class) if (!methodsWithDependentPointers.Any()) return false; + var hasMethods = false; var classExtensions = new Class { Name = $"{@class.Name}Extensions", IsStatic = true }; foreach (var specialization in @class.Specializations.Where(s => s.IsGenerated)) foreach (var method in methodsWithDependentPointers.Where( @@ -59,9 +60,11 @@ public override bool VisitClassDecl(Class @class) { var specializedMethod = specialization.Methods.FirstOrDefault( m => m.InstantiatedFrom == method); - if (specializedMethod == null) + if (specializedMethod == null || specializedMethod.IsOperator) continue; + hasMethods = true; + Method extensionMethod = GetExtensionMethodForDependentPointer(specializedMethod); classExtensions.Methods.Add(extensionMethod); extensionMethod.Namespace = classExtensions; @@ -75,6 +78,10 @@ public override bool VisitClassDecl(Class @class) extensionMethod.GenerationKind = GenerationKind.Generate; } } + + if (!hasMethods) + return false; + classExtensions.Namespace = @class.Namespace; classExtensions.OriginalClass = @class; extensions.Add(classExtensions); diff --git a/src/Generator/Passes/ValidateOperatorsPass.cs b/src/Generator/Passes/ValidateOperatorsPass.cs index 2b79ad9459..03dbd4dd52 100644 --- a/src/Generator/Passes/ValidateOperatorsPass.cs +++ b/src/Generator/Passes/ValidateOperatorsPass.cs @@ -87,15 +87,16 @@ private bool IsValidOperatorOverload(Method @operator) { Parameter parameter = @operator.Parameters.Last(); Type type = parameter.Type.Desugar(); - switch (Options.GeneratorKind) + var kind = Options.GeneratorKind; + switch (kind) { - case GeneratorKind.CLI: + case var _ when ReferenceEquals(kind, GeneratorKind.CLI): return type.IsPrimitiveType(PrimitiveType.Int); - case GeneratorKind.CSharp: + case var _ when ReferenceEquals(kind, GeneratorKind.CSharp): Types.TypeMap typeMap; - if (Context.TypeMaps.FindTypeMap(type, out typeMap)) + if (Context.TypeMaps.FindTypeMap(type, GeneratorKind.CSharp, out typeMap)) { - var mappedTo = typeMap.CSharpSignatureType( + var mappedTo = typeMap.SignatureType( new TypePrinterContext { Parameter = parameter, diff --git a/src/Generator/Types/DeclMap.cs b/src/Generator/Types/DeclMap.cs index 5028466ca3..d1e9b63f97 100644 --- a/src/Generator/Types/DeclMap.cs +++ b/src/Generator/Types/DeclMap.cs @@ -35,7 +35,7 @@ public class DeclMapAttribute : Attribute { public GeneratorKind GeneratorKind { get; set; } - public DeclMapAttribute() : this(0) + public DeclMapAttribute() { } diff --git a/src/Generator/Types/DeclMapDatabase.cs b/src/Generator/Types/DeclMapDatabase.cs index 7cb891c3ab..2bdc7b0906 100644 --- a/src/Generator/Types/DeclMapDatabase.cs +++ b/src/Generator/Types/DeclMapDatabase.cs @@ -41,7 +41,7 @@ private void SetupDeclMaps(IEnumerable types, var attrs = type.GetCustomAttributes(typeof(DeclMapAttribute), true); foreach (DeclMapAttribute attr in attrs) { - if (attr.GeneratorKind == 0 || + if (attr.GeneratorKind == null || attr.GeneratorKind == bindingContext.Options.GeneratorKind) { var declMap = (DeclMap)Activator.CreateInstance(type); diff --git a/src/Generator/Types/Std/Stdlib.CLI.cs b/src/Generator/Types/Std/Stdlib.CLI.cs index d067c95817..2f12e5b416 100644 --- a/src/Generator/Types/Std/Stdlib.CLI.cs +++ b/src/Generator/Types/Std/Stdlib.CLI.cs @@ -5,19 +5,18 @@ using CppSharp.Generators.AST; using CppSharp.Generators.C; using CppSharp.Generators.CLI; -using CppSharp.Generators.CSharp; -namespace CppSharp.Types.Std +namespace CppSharp.Types.Std.CLI { - [TypeMap("const char*", GeneratorKind = GeneratorKind.CLI)] - public partial class ConstCharPointer : TypeMap + [TypeMap("const char*", GeneratorKindID = GeneratorKind.CLI_ID)] + public class ConstCharPointer : TypeMap { - public override Type CLISignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new CILType(typeof(string)); } - public override void CLIMarshalToNative(MarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { ctx.Before.WriteLine( "auto _{0} = clix::marshalString({1});", @@ -26,7 +25,7 @@ public override void CLIMarshalToNative(MarshalContext ctx) ctx.Return.Write("_{0}.c_str()", ctx.ArgName); } - public override void CLIMarshalToManaged(MarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { if (ctx.Parameter != null && !ctx.Parameter.IsOut && !ctx.Parameter.IsInOut) @@ -57,75 +56,74 @@ public override void CLIMarshalToManaged(MarshalContext ctx) $"{Context.Options.Encoding.EncodingName} is not supported yet."); ctx.Return.Write( - $@"({ctx.ReturnVarName} == 0 ? nullptr : clix::marshalString({ctx.ReturnVarName}))"); + $@"({ctx.ReturnVarName} == 0 ? nullptr : clix::marshalString({ctx.ReturnVarName}))"); } } - [TypeMap("const char[]", GeneratorKind = GeneratorKind.CLI)] - public partial class ConstCharArray : ConstCharPointer + [TypeMap("const char[]", GeneratorKindID = GeneratorKind.CLI_ID)] + public class ConstCharArray : ConstCharPointer { } - [TypeMap("const wchar_t*", GeneratorKind = GeneratorKind.CLI)] - public partial class ConstWCharTPointer : ConstCharPointer + [TypeMap("const wchar_t*", GeneratorKindID = GeneratorKind.CLI_ID)] + public class ConstWCharTPointer : ConstCharPointer { } - [TypeMap("const char16_t*", GeneratorKind = GeneratorKind.CLI)] - public partial class ConstChar16TPointer : ConstCharPointer + [TypeMap("const char16_t*", GeneratorKindID = GeneratorKind.CLI_ID)] + public class ConstChar16TPointer : ConstCharPointer { } - [TypeMap("const char32_t*", GeneratorKind = GeneratorKind.CLI)] - public partial class ConstChar32TPointer : ConstCharPointer + [TypeMap("const char32_t*", GeneratorKindID = GeneratorKind.CLI_ID)] + public class ConstChar32TPointer : ConstCharPointer { } - [TypeMap("basic_string, allocator>", GeneratorKind = GeneratorKind.CLI)] - public partial class String : TypeMap + [TypeMap("basic_string, allocator>", GeneratorKindID = GeneratorKind.CLI_ID)] + public class String : TypeMap { - public override Type CLISignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new CILType(typeof(string)); } - public override void CLIMarshalToNative(MarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { ctx.Return.Write("clix::marshalString({0})", ctx.Parameter.Name); } - public override void CLIMarshalToManaged(MarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { ctx.Return.Write("clix::marshalString({0})", ctx.ReturnVarName); } } - [TypeMap("std::wstring", GeneratorKind = GeneratorKind.CLI)] - public partial class WString : TypeMap + [TypeMap("std::wstring", GeneratorKindID = GeneratorKind.CLI_ID)] + public class WString : TypeMap { - public override Type CLISignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new CILType(typeof(string)); } - public override void CLIMarshalToNative(MarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { ctx.Return.Write("clix::marshalString({0})", ctx.Parameter.Name); } - public override void CLIMarshalToManaged(MarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { ctx.Return.Write("clix::marshalString({0})", ctx.ReturnVarName); } } - [TypeMap("std::vector", GeneratorKind = GeneratorKind.CLI)] - public partial class Vector : TypeMap + [TypeMap("std::vector", GeneratorKindID = GeneratorKind.CLI_ID)] + public class Vector : TypeMap { public override bool IsIgnored { @@ -145,13 +143,13 @@ public override bool IsIgnored } } - public override Type CLISignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new CustomType( $"::System::Collections::Generic::List<{ctx.GetTemplateParameterList()}>^"); } - public override void CLIMarshalToNative(MarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { var desugared = Type.Desugar(); var templateType = desugared as TemplateSpecializationType; @@ -209,7 +207,7 @@ public override void CLIMarshalToNative(MarshalContext ctx) ctx.Return.Write(tmpVarName); } - public override void CLIMarshalToManaged(MarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { var desugared = Type.Desugar(); var templateType = desugared as TemplateSpecializationType; @@ -258,62 +256,50 @@ public override void CLIMarshalToManaged(MarshalContext ctx) } } - [TypeMap("std::map", GeneratorKind = GeneratorKind.CLI)] - public partial class Map : TypeMap + [TypeMap("std::map", GeneratorKindID = GeneratorKind.CLI_ID)] + public class Map : TypeMap { public override bool IsIgnored { get { return true; } } - public override Type CLISignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { var type = Type as TemplateSpecializationType; return new CustomType( - $@"::System::Collections::Generic::Dictionary<{ - type.Arguments[0].Type}, {type.Arguments[1].Type}>^"); + $@"::System::Collections::Generic::Dictionary<{type.Arguments[0].Type}, {type.Arguments[1].Type}>^"); } - public override void CLIMarshalToNative(MarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { throw new System.NotImplementedException(); } - public override void CLIMarshalToManaged(MarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { throw new System.NotImplementedException(); } - - public override Type CSharpSignatureType(TypePrinterContext ctx) - { - if (ctx.Kind == TypePrinterContextKind.Native) - return new CustomType("Std.Map"); - - var type = Type as TemplateSpecializationType; - return new CustomType( - $@"System.Collections.Generic.Dictionary<{ - type.Arguments[0].Type}, {type.Arguments[1].Type}>"); - } } - [TypeMap("std::list", GeneratorKind = GeneratorKind.CLI)] - public partial class List : TypeMap + [TypeMap("std::list", GeneratorKindID = GeneratorKind.CLI_ID)] + public class List : TypeMap { public override bool IsIgnored { get { return true; } } } - [TypeMap("std::shared_ptr", GeneratorKind = GeneratorKind.CLI)] - public partial class SharedPtr : TypeMap + [TypeMap("std::shared_ptr", GeneratorKindID = GeneratorKind.CLI_ID)] + public class SharedPtr : TypeMap { public override bool IsIgnored { get { return true; } } } - [TypeMap("basic_ostream>", GeneratorKind.CLI)] - public partial class OStream : TypeMap + [TypeMap("basic_ostream>", GeneratorKind.CLI_ID)] + public class OStream : TypeMap { - public override Type CLISignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new CILType(typeof(System.IO.TextWriter)); } - public override void CLIMarshalToNative(MarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { var marshal = (CLIMarshalManagedToNativePrinter)ctx.MarshalToNative; if (!ctx.Parameter.Type.Desugar().IsPointer()) @@ -325,8 +311,8 @@ public override void CLIMarshalToNative(MarshalContext ctx) } } - [TypeMap("std::nullptr_t", GeneratorKind = GeneratorKind.CLI)] - public partial class NullPtr : TypeMap + [TypeMap("std::nullptr_t", GeneratorKindID = GeneratorKind.CLI_ID)] + public class NullPtr : TypeMap { public override bool DoesMarshalling { get { return false; } } diff --git a/src/Generator/Types/Std/Stdlib.CSharp.cs b/src/Generator/Types/Std/Stdlib.CSharp.cs index 83df7b1cd2..e69de8e7e2 100644 --- a/src/Generator/Types/Std/Stdlib.CSharp.cs +++ b/src/Generator/Types/Std/Stdlib.CSharp.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; @@ -6,47 +7,48 @@ using CppSharp.AST.Extensions; using CppSharp.Generators; using CppSharp.Generators.CSharp; +using Type = CppSharp.AST.Type; -namespace CppSharp.Types.Std +namespace CppSharp.Types.Std.CSharp { - [TypeMap("int", GeneratorKind = GeneratorKind.CSharp)] - public partial class Int : TypeMap + [TypeMap("int", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class Int : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) => + public override Type SignatureType(TypePrinterContext ctx) => CSharpTypePrinter.GetSignedType(Context.TargetInfo.IntWidth); } - [TypeMap("unsigned int", GeneratorKind = GeneratorKind.CSharp)] - public partial class UnsignedInt : TypeMap + [TypeMap("unsigned int", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class UnsignedInt : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) => + public override Type SignatureType(TypePrinterContext ctx) => CSharpTypePrinter.GetUnsignedType(Context.TargetInfo.IntWidth); } - [TypeMap("long", GeneratorKind = GeneratorKind.CSharp)] - public partial class Long : TypeMap + [TypeMap("long", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class Long : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) => + public override Type SignatureType(TypePrinterContext ctx) => CSharpTypePrinter.GetSignedType(Context.TargetInfo.LongWidth); } - [TypeMap("unsigned long", GeneratorKind = GeneratorKind.CSharp)] - public partial class UnsignedLong : TypeMap + [TypeMap("unsigned long", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class UnsignedLong : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) => + public override Type SignatureType(TypePrinterContext ctx) => CSharpTypePrinter.GetUnsignedType(Context.TargetInfo.LongWidth); } - [TypeMap("char", GeneratorKind = GeneratorKind.CSharp)] - public partial class Char : TypeMap + [TypeMap("char", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class Char : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new CILType(ctx.Kind == TypePrinterContextKind.Native || !Context.Options.MarshalCharAsManagedChar ? typeof(sbyte) : typeof(char)); } - public override void CSharpMarshalToNative(CSharpMarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { if (Context.Options.MarshalCharAsManagedChar) ctx.Return.Write("global::System.Convert.ToSByte({0})", @@ -55,7 +57,7 @@ public override void CSharpMarshalToNative(CSharpMarshalContext ctx) ctx.Return.Write(ctx.Parameter.Name); } - public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { if (Context.Options.MarshalCharAsManagedChar) ctx.Return.Write("global::System.Convert.ToChar({0})", @@ -65,28 +67,28 @@ public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) } } - [TypeMap("char16_t", GeneratorKind = GeneratorKind.CSharp)] - public partial class Char16T : TypeMap + [TypeMap("char16_t", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class Char16T : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new CILType(typeof(char)); } } - [TypeMap("wchar_t", GeneratorKind = GeneratorKind.CSharp)] - public partial class WCharT : TypeMap + [TypeMap("wchar_t", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class WCharT : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new CILType(typeof(char)); } } - [TypeMap("const char*", GeneratorKind = GeneratorKind.CSharp)] - public partial class ConstCharPointer : TypeMap + [TypeMap("const char*", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class ConstCharPointer : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { if (ctx.Kind == TypePrinterContextKind.Managed) return new CILType(typeof(string)); @@ -115,7 +117,7 @@ public override Type CSharpSignatureType(TypePrinterContext ctx) $"{Context.Options.Encoding.EncodingName} is not supported yet."); } - public override void CSharpMarshalToNative(CSharpMarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { string param = ctx.Parameter.Name; if (ctx.Parameter.Usage == ParameterUsage.Unknown && @@ -145,7 +147,7 @@ public override void CSharpMarshalToNative(CSharpMarshalContext ctx) // would be really helpful to have ctx hold a Decl property representing the // "appropriate" Decl when we get here. When MarshalKind == NativeField, Decl would // be set to the Field we're operating on. - var fieldName = ctx.ReturnVarName.Substring(ctx.ReturnVarName.LastIndexOf("->") + 2); + var fieldName = ctx.ReturnVarName[Math.Max(ctx.ReturnVarName.LastIndexOf('.') + 1, ctx.ReturnVarName.LastIndexOf("->") + 2)..]; ctx.Before.WriteLine($"if (__{fieldName}_OwnsNativeMemory)"); ctx.Before.WriteLineIndent($"Marshal.FreeHGlobal({ctx.ReturnVarName});"); @@ -192,7 +194,7 @@ public override void CSharpMarshalToNative(CSharpMarshalContext ctx) ctx.Return.Write($"{bytePtr}"); } - public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { if (ctx.Parameter != null && !ctx.Parameter.IsOut && !ctx.Parameter.IsInOut) @@ -279,30 +281,30 @@ public uint GetCharPtrWidth(PointerType pointer) } } - [TypeMap("const char[]", GeneratorKind = GeneratorKind.CSharp)] - public partial class ConstCharArray : ConstCharPointer + [TypeMap("const char[]", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class ConstCharArray : ConstCharPointer { } - [TypeMap("const wchar_t*", GeneratorKind = GeneratorKind.CSharp)] - public partial class ConstWCharTPointer : ConstCharPointer + [TypeMap("const wchar_t*", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class ConstWCharTPointer : ConstCharPointer { } - [TypeMap("const char16_t*", GeneratorKind = GeneratorKind.CSharp)] - public partial class ConstChar16TPointer : ConstCharPointer + [TypeMap("const char16_t*", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class ConstChar16TPointer : ConstCharPointer { } - [TypeMap("const char32_t*", GeneratorKind = GeneratorKind.CSharp)] - public partial class ConstChar32TPointer : ConstCharPointer + [TypeMap("const char32_t*", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class ConstChar32TPointer : ConstCharPointer { } - [TypeMap("basic_string, allocator>", GeneratorKind = GeneratorKind.CSharp)] - public partial class String : TypeMap + [TypeMap("basic_string, allocator>", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class String : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { if (ctx.Kind == TypePrinterContextKind.Managed) return new CILType(typeof(string)); @@ -314,7 +316,7 @@ public override Type CSharpSignatureType(TypePrinterContext ctx) return new CustomType(basicString.Visit(typePrinter).Type); } - public override void CSharpMarshalToNative(CSharpMarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { Type type = ctx.Parameter.Type.Desugar(); ClassTemplateSpecialization basicString = GetBasicString(type); @@ -326,26 +328,40 @@ public override void CSharpMarshalToNative(CSharpMarshalContext ctx) var assign = basicString.Methods.First(m => m.OriginalName == "assign"); if (ctx.MarshalKind == MarshalKind.NativeField) { - ctx.Return.Write($@"{qualifiedBasicString}Extensions.{ - Helpers.InternalStruct}.{assign.Name}(new { - typePrinter.IntPtrType}(&{ - ctx.ReturnVarName}), {ctx.Parameter.Name})"); + string var; + if (ctx.ReturnVarName.LastIndexOf('.') > ctx.ReturnVarName.LastIndexOf("->")) + { + var = Generator.GeneratedIdentifier(ctx.ArgName); + ctx.Before.WriteLine($"fixed (void* {var} = &{ctx.ReturnVarName})"); + ctx.Before.WriteOpenBraceAndIndent(); + (ctx as CSharpMarshalContext).HasCodeBlock = true; + } + else + { + var = $"&{ctx.ReturnVarName}"; + } + ctx.Return.Write($@"{qualifiedBasicString}Extensions.{Helpers.InternalStruct}.{assign.Name}(new {typePrinter.IntPtrType}({var}), "); + if (ctx.Parameter.Type.IsTemplateParameterType()) + ctx.Return.Write("(string) (object) "); + ctx.Return.Write($"{ctx.Parameter.Name})"); ctx.ReturnVarName = string.Empty; } else { var varBasicString = $"__basicString{ctx.ParameterIndex}"; - ctx.Before.WriteLine($@"var {varBasicString} = new { - basicString.Visit(typePrinter)}();"); - ctx.Before.WriteLine($@"{qualifiedBasicString}Extensions.{ - assign.Name}({varBasicString}, {ctx.Parameter.Name});"); + ctx.Before.WriteLine($@"var {varBasicString} = new {basicString.Visit(typePrinter)}();"); + + ctx.Before.Write($@"{qualifiedBasicString}Extensions.{assign.Name}({varBasicString}, "); + if (ctx.Parameter.Type.IsTemplateParameterType()) + ctx.Before.Write("(string) (object) "); + ctx.Before.WriteLine($"{ctx.Parameter.Name});"); + ctx.Return.Write($"{varBasicString}.{Helpers.InstanceIdentifier}"); - ctx.Cleanup.WriteLine($@"{varBasicString}.Dispose({ - (!Type.IsAddress() || ctx.Parameter?.IsIndirect == true ? "disposing: true, callNativeDtor:false" : string.Empty)});"); + ctx.Cleanup.WriteLine($@"{varBasicString}.Dispose({(!Type.IsAddress() || ctx.Parameter?.IsIndirect == true ? "disposing: true, callNativeDtor:false" : string.Empty)});"); } } - public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { var type = Type.Desugar(resolveTemplateSubstitution: false); ClassTemplateSpecialization basicString = GetBasicString(type); @@ -355,10 +371,7 @@ public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) string varBasicString = $"__basicStringRet{ctx.ParameterIndex}"; bool usePointer = type.IsAddress() || ctx.MarshalKind == MarshalKind.NativeField || ctx.MarshalKind == MarshalKind.ReturnVariableArray; - ctx.Before.WriteLine($@"var {varBasicString} = { - basicString.Visit(typePrinter)}.{Helpers.CreateInstanceIdentifier}({ - (usePointer ? string.Empty : $"new {typePrinter.IntPtrType}(&")}{ - ctx.ReturnVarName}{(usePointer ? string.Empty : ")")});"); + ctx.Before.WriteLine($@"var {varBasicString} = {basicString.Visit(typePrinter)}.{Helpers.CreateInstanceIdentifier}({(usePointer ? string.Empty : $"new {typePrinter.IntPtrType}(&")}{ctx.ReturnVarName}{(usePointer ? string.Empty : ")")});"); string @string = $"{qualifiedBasicString}Extensions.{data.Name}({varBasicString})"; if (usePointer) { @@ -399,10 +412,10 @@ private static ClassTemplateSpecialization GetBasicString(Type type) } } - [TypeMap("FILE", GeneratorKind = GeneratorKind.CSharp)] - public partial class FILE : TypeMap + [TypeMap("FILE", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class FILE : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new CILType(typeof(System.IntPtr)); } diff --git a/src/Generator/Types/TypeIgnoreChecker.cs b/src/Generator/Types/TypeIgnoreChecker.cs index f06612c7d8..707a16774d 100644 --- a/src/Generator/Types/TypeIgnoreChecker.cs +++ b/src/Generator/Types/TypeIgnoreChecker.cs @@ -13,14 +13,17 @@ public class TypeIgnoreChecker : AstVisitor ITypeMapDatabase TypeMapDatabase { get; } public bool IsIgnored; - public TypeIgnoreChecker(ITypeMapDatabase database, - GeneratorKind generatorKind = GeneratorKind.CSharp) + public TypeIgnoreChecker(ITypeMapDatabase database, GeneratorKind generatorKind) { TypeMapDatabase = database; VisitOptions.ClearFlags(VisitFlags.ClassBases | VisitFlags.TemplateArguments); this.generatorKind = generatorKind; } + public TypeIgnoreChecker(ITypeMapDatabase database) : this(database, GeneratorKind.CSharp) + { + } + void Ignore() { IsIgnored = true; diff --git a/src/Generator/Types/TypeMap.cs b/src/Generator/Types/TypeMap.cs index 54d5cfa4bc..5f701c6c4a 100644 --- a/src/Generator/Types/TypeMap.cs +++ b/src/Generator/Types/TypeMap.cs @@ -2,10 +2,7 @@ using CppSharp.AST; using CppSharp.Generators; using CppSharp.Generators.AST; -using CppSharp.Generators.C; using CppSharp.Generators.CLI; -using CppSharp.Generators.Cpp; -using CppSharp.Generators.CSharp; using Attribute = System.Attribute; using Type = CppSharp.AST.Type; @@ -15,17 +12,17 @@ namespace CppSharp.Types public class TypeMapAttribute : Attribute { public string Type { get; } - public GeneratorKind GeneratorKind { get; set; } + public string GeneratorKindID { get; set; } - public TypeMapAttribute(string type) : this(type, 0) + public TypeMapAttribute(string type) : this(type, null) { Type = type; } - public TypeMapAttribute(string type, GeneratorKind generatorKind) + public TypeMapAttribute(string type, string generatorKindID) { Type = type; - GeneratorKind = generatorKind; + GeneratorKindID = generatorKindID; } } @@ -51,77 +48,23 @@ public class TypeMap /// public virtual bool DoesMarshalling => true; - public virtual Type SignatureType(GeneratorKind kind, TypePrinterContext ctx) - { - switch (kind) - { - case GeneratorKind.C: - case GeneratorKind.CPlusPlus: - return CppSignatureType(ctx); - case GeneratorKind.CLI: - return CLISignatureType(ctx); - case GeneratorKind.CSharp: - return CSharpSignatureType(ctx); - default: - throw new System.NotImplementedException(); - } - } - - public virtual void MarshalToNative(GeneratorKind kind, MarshalContext ctx) - { - switch (kind) - { - case GeneratorKind.C: - case GeneratorKind.CPlusPlus: - CppMarshalToNative(ctx); - return; - case GeneratorKind.CLI: - CLIMarshalToNative(ctx); - return; - case GeneratorKind.CSharp: - CSharpMarshalToNative(ctx as CSharpMarshalContext); - return; - default: - throw new System.NotImplementedException(); - } - } - - public virtual void MarshalToManaged(GeneratorKind kind, MarshalContext ctx) - { - switch (kind) - { - case GeneratorKind.C: - case GeneratorKind.CPlusPlus: - CppMarshalToManaged(ctx); - return; - case GeneratorKind.CLI: - CLIMarshalToManaged(ctx); - return; - case GeneratorKind.CSharp: - CSharpMarshalToManaged(ctx as CSharpMarshalContext); - return; - default: - throw new System.NotImplementedException(); - } - } - - #region C# backend - - public virtual Type CSharpSignatureType(TypePrinterContext ctx) + public virtual Type SignatureType(TypePrinterContext ctx) { return new CILType(typeof(object)); } - public virtual void CSharpMarshalToNative(CSharpMarshalContext ctx) + public virtual void MarshalToNative(MarshalContext ctx) { ctx.Return.Write(ctx.Parameter.Name); } - public virtual void CSharpMarshalToManaged(CSharpMarshalContext ctx) + public virtual void MarshalToManaged(MarshalContext ctx) { ctx.Return.Write(ctx.ReturnVarName); } + #region C# backend + /// /// Used to construct a new instance of the mapped type. /// @@ -135,55 +78,18 @@ public virtual string CSharpConstruct() #region C++/CLI backend - public virtual Type CLISignatureType(TypePrinterContext ctx) - { - return new CILType(typeof(object)); - } - public virtual void CLITypeReference(CLITypeReferenceCollector collector, ASTRecord loc) { } - public virtual void CLIMarshalToNative(MarshalContext ctx) - { - ctx.Return.Write(ctx.Parameter.Name); - } - - public virtual void CLIMarshalToManaged(MarshalContext ctx) - { - ctx.Return.Write(ctx.ReturnVarName); - } - #endregion - - #region C++ backend - - public virtual Type CppSignatureType(TypePrinterContext ctx) - { - return new CILType(typeof(object)); - } - - public virtual void CppTypeReference(CLITypeReference collector, ASTRecord record) - { - throw new NotImplementedException(); - } - - public virtual void CppMarshalToNative(MarshalContext ctx) - { - ctx.Return.Write(ctx.Parameter.Name); - } - - public virtual void CppMarshalToManaged(MarshalContext ctx) - { - ctx.Return.Write(ctx.ReturnVarName); - } - - #endregion } public interface ITypeMapDatabase { bool FindTypeMap(Type decl, out TypeMap typeMap); + bool FindTypeMap(Type decl, GeneratorKind kind, out TypeMap typeMap); bool FindTypeMap(Declaration declaration, out TypeMap typeMap); + bool FindTypeMap(Declaration declaration, GeneratorKind kind, out TypeMap typeMap); } } diff --git a/src/Generator/Types/TypeMapDatabase.cs b/src/Generator/Types/TypeMapDatabase.cs index fef279abf2..904d58a929 100644 --- a/src/Generator/Types/TypeMapDatabase.cs +++ b/src/Generator/Types/TypeMapDatabase.cs @@ -10,13 +10,16 @@ namespace CppSharp.Types { public class TypeMapDatabase : ITypeMapDatabase { - public IDictionary TypeMaps { get; set; } private readonly BindingContext Context; + private readonly Dictionary> typeMapsCache = new(); + + public Dictionary> GlobalTypeMaps { get; private set; } + public Dictionary TypeMaps => TypeMapsByKind(GlobalTypeMaps, Context.Options.GeneratorKind); public TypeMapDatabase(BindingContext bindingContext) { Context = bindingContext; - TypeMaps = new Dictionary(); + GlobalTypeMaps = new Dictionary>(); foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { try @@ -32,33 +35,22 @@ public TypeMapDatabase(BindingContext bindingContext) } } - private void SetupTypeMaps(IEnumerable types, - BindingContext bindingContext) + public static Dictionary TypeMapsByKind(Dictionary> typeMapsDictionary, GeneratorKind kind) { - foreach (var type in types) + if (!typeMapsDictionary.TryGetValue(kind, out Dictionary typeMap)) { - var attrs = type.GetCustomAttributes(typeof(TypeMapAttribute), true); - foreach (TypeMapAttribute attr in attrs) - { - if (attr.GeneratorKind == 0 || - attr.GeneratorKind == bindingContext.Options.GeneratorKind) - { - var typeMap = (TypeMap)Activator.CreateInstance(type); - typeMap.Context = bindingContext; - typeMap.TypeMapDatabase = this; - - // Custom types won't be overwritten by CppSharp ones. - if (!TypeMaps.ContainsKey(attr.Type)) - { - TypeMaps.Add(attr.Type, typeMap); - } - } - } + typeMap = new Dictionary(); + typeMapsDictionary.Add(kind, typeMap); } + return typeMap; } - public bool FindTypeMap(Type type, out TypeMap typeMap) + public bool FindTypeMap(Type type, out TypeMap typeMap) => + FindTypeMap(type, Context.Options.GeneratorKind, out typeMap); + + public bool FindTypeMap(Type type, GeneratorKind kind, out TypeMap typeMap) { + var typeMaps = TypeMapsByKind(typeMapsCache, kind); // Looks up the type in the cache map. if (typeMaps.ContainsKey(type)) { @@ -72,13 +64,12 @@ public bool FindTypeMap(Type type, out TypeMap typeMap) { var specialization = template.GetClassTemplateSpecialization(); if (specialization != null && - FindTypeMap(specialization, out typeMap)) + FindTypeMap(specialization, kind, out typeMap)) return true; if (template.Template.TemplatedDecl != null) { - if (FindTypeMap(template.Template.TemplatedDecl, - out typeMap)) + if (FindTypeMap(template.Template.TemplatedDecl, kind, out typeMap)) { typeMap.Type = type; return true; @@ -113,7 +104,7 @@ public bool FindTypeMap(Type type, out TypeMap typeMap) typePrinter.PushScope(typePrintScopeKind); var typeName = type.Visit(typePrinter); typePrinter.PopScope(); - if (FindTypeMap(typeName, out typeMap)) + if (FindTypeMap(typeName, kind, out typeMap)) { typeMap.Type = type; typeMaps[type] = typeMap; @@ -127,11 +118,33 @@ public bool FindTypeMap(Type type, out TypeMap typeMap) } public bool FindTypeMap(Declaration declaration, out TypeMap typeMap) => - FindTypeMap(new TagType(declaration), out typeMap); + FindTypeMap(declaration, Context.Options.GeneratorKind, out typeMap); + + public bool FindTypeMap(Declaration declaration, GeneratorKind kind, out TypeMap typeMap) => + FindTypeMap(new TagType(declaration), kind, out typeMap); - public bool FindTypeMap(string name, out TypeMap typeMap) => - TypeMaps.TryGetValue(name, out typeMap) && typeMap.IsEnabled; + public bool FindTypeMap(string name, GeneratorKind kind, out TypeMap typeMap) => + TypeMapsByKind(GlobalTypeMaps, kind).TryGetValue(name, out typeMap) && typeMap.IsEnabled; - private Dictionary typeMaps = new Dictionary(); + private void SetupTypeMaps(IEnumerable types, BindingContext bindingContext) + { + foreach (var type in types) + { + var attrs = type.GetCustomAttributes(typeof(TypeMapAttribute), true); + foreach (TypeMapAttribute attr in attrs) + { + var kind = string.IsNullOrEmpty(attr.GeneratorKindID) ? Context.Options.GeneratorKind : GeneratorKind.FindGeneratorKindByID(attr.GeneratorKindID); + var typeMaps = TypeMapsByKind(GlobalTypeMaps, kind); + // Custom types won't be overwritten by CppSharp ones. + if (!typeMaps.ContainsKey(attr.Type)) + { + var typeMap = (TypeMap)Activator.CreateInstance(type); + typeMap.Context = bindingContext; + typeMap.TypeMapDatabase = this; + typeMaps.Add(attr.Type, typeMap); + } + } + } + } } } diff --git a/src/Parser/ASTConverter.cs b/src/Parser/ASTConverter.cs index 1c03e93906..81332f0279 100644 --- a/src/Parser/ASTConverter.cs +++ b/src/Parser/ASTConverter.cs @@ -1719,10 +1719,12 @@ AST.CppAbi VisitCppAbi(CppAbi abi) return AST.CppAbi.Microsoft; case CppAbi.ARM: return AST.CppAbi.ARM; + case CppAbi.AArch64: + return AST.CppAbi.AArch64; case CppAbi.iOS: return AST.CppAbi.iOS; - case CppAbi.iOS64: - return AST.CppAbi.iOS64; + case CppAbi.AppleARM64: + return AST.CppAbi.AppleARM64; case CppAbi.WebAssembly: return AST.CppAbi.WebAssembly; default: @@ -1918,6 +1920,12 @@ public override AST.Declaration VisitClassTemplatePartialSpecialization( { var _decl = new AST.ClassTemplatePartialSpecialization(); VisitClassTemplateSpecialization(decl, _decl); + for (uint i = 0; i < decl.ParametersCount; ++i) + { + var param = decl.GetParameters(i); + var _param = Visit(param); + _decl.Parameters.Add(_param); + } return _decl; } diff --git a/tests/dotnet/CLI/CLI.Gen.cs b/tests/dotnet/CLI/CLI.Gen.cs index 3b7837edd7..586fd43397 100644 --- a/tests/dotnet/CLI/CLI.Gen.cs +++ b/tests/dotnet/CLI/CLI.Gen.cs @@ -1,59 +1,68 @@ using CppSharp.AST; using CppSharp.Generators; using CppSharp.Generators.C; -using CppSharp.Passes; using CppSharp.Types; using CppSharp.Utils; namespace CppSharp.Tests { - [TypeMap("IgnoredClassTemplateForEmployee")] + [TypeMap("IgnoredClassTemplateForEmployee", GeneratorKindID = GeneratorKind.CLI_ID)] public class IgnoredClassTemplateForEmployeeMap : TypeMap { - public override Type CLISignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new CustomType("CLI::Employee^"); } - public override void CLIMarshalToManaged(MarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { ctx.Return.Write($"gcnew CLI::Employee({ctx.ReturnVarName}.m_employee)"); } } - [TypeMap("TestMappedTypeNonConstRefParam")] - public class TestMappedTypeNonConstRefParamTypeMap : TypeMap + namespace CLI { - public override Type CLISignatureType(TypePrinterContext ctx) + [TypeMap("TestMappedTypeNonConstRefParam", GeneratorKindID = GeneratorKind.CLI_ID)] + public class TestMappedTypeNonConstRefParamTypeMap : TypeMap { - return new CILType(typeof(string)); - } + public override Type SignatureType(TypePrinterContext ctx) + { + return new CILType(typeof(string)); + } - public override Type CppSignatureType(TypePrinterContext ctx) - { - var tagType = ctx.Type as TagType; - var typePrinter = new CppTypePrinter(Context); - return new CustomType(tagType.Declaration.Visit(typePrinter)); - } + public override void MarshalToManaged(MarshalContext ctx) + { + ctx.Return.Write("clix::marshalString({0}.m_str)", ctx.ReturnVarName); + } - public override void CLIMarshalToManaged(MarshalContext ctx) - { - ctx.Return.Write("clix::marshalString({0}.m_str)", ctx.ReturnVarName); + public override void MarshalToNative(MarshalContext ctx) + { + if (ctx.Parameter.Usage == ParameterUsage.InOut) + { + ctx.Before.WriteLine($"System::String^ _{ctx.Parameter.Name} = {ctx.Parameter.Name};"); + } + + string paramName = ctx.Parameter.Usage == ParameterUsage.InOut ? $"_{ctx.Parameter.Name}" : ctx.Parameter.Name; + + ctx.Before.WriteLine( + $"::TestMappedTypeNonConstRefParam _{ctx.ArgName} = clix::marshalString({paramName});"); + + ctx.Return.Write("_{0}", ctx.ArgName); + } } + } - public override void CLIMarshalToNative(MarshalContext ctx) + namespace Cpp + { + [TypeMap("TestMappedTypeNonConstRefParam", GeneratorKindID = GeneratorKind.CPlusPlus_ID)] + public class TestMappedTypeNonConstRefParamTypeMap : TypeMap { - if (ctx.Parameter.Usage == ParameterUsage.InOut) + public override Type SignatureType(TypePrinterContext ctx) { - ctx.Before.WriteLine($"System::String^ _{ctx.Parameter.Name} = {ctx.Parameter.Name};"); + var tagType = ctx.Type as TagType; + var typePrinter = new CppTypePrinter(Context); + return new CustomType(tagType.Declaration.Visit(typePrinter)); } - - string paramName = ctx.Parameter.Usage == ParameterUsage.InOut ? $"_{ctx.Parameter.Name}" : ctx.Parameter.Name; - - ctx.Before.WriteLine( - $"::TestMappedTypeNonConstRefParam _{ctx.ArgName} = clix::marshalString({paramName});"); - - ctx.Return.Write("_{0}", ctx.ArgName); } } @@ -68,6 +77,7 @@ public override void Setup(Driver driver) { driver.Options.GenerateFinalizers = true; driver.Options.GenerateObjectOverrides = true; + driver.Options.GenerateFreeStandingFunctionsClassName = tu => tu.FileNameWithoutExtension + "Cool"; base.Setup(driver); } diff --git a/tests/dotnet/CLI/CLI.Tests.cs b/tests/dotnet/CLI/CLI.Tests.cs index ba58da3ff9..54de7959d2 100644 --- a/tests/dotnet/CLI/CLI.Tests.cs +++ b/tests/dotnet/CLI/CLI.Tests.cs @@ -78,7 +78,7 @@ public void TestMultipleConstantArraysParamsTestMethod() byte[] bytes2 = Encoding.ASCII.GetBytes("TestMulti2"); sbyte[] sbytes2 = Array.ConvertAll(bytes2, q => Convert.ToSByte(q)); - string s = CLI.CLI.MultipleConstantArraysParamsTestMethod(sbytes, sbytes2); + string s = CLI.CLICool.MultipleConstantArraysParamsTestMethod(sbytes, sbytes2); Assert.AreEqual("TestMultiTestMulti2", s); } @@ -88,7 +88,7 @@ public void TestMultipleConstantArraysParamsTestMethodLongerSourceArray() byte[] bytes = Encoding.ASCII.GetBytes("TestMultipleConstantArraysParamsTestMethodLongerSourceArray"); sbyte[] sbytes = Array.ConvertAll(bytes, q => Convert.ToSByte(q)); - Assert.Throws(() => CLI.CLI.MultipleConstantArraysParamsTestMethod(sbytes, new sbyte[] { })); + Assert.Throws(() => CLI.CLICool.MultipleConstantArraysParamsTestMethod(sbytes, new sbyte[] { })); } [Test] @@ -110,7 +110,7 @@ public void TestStructWithNestedUnionTestMethod() Assert.AreEqual(10, val.NestedUnion.SzText.Length); Assert.AreEqual("TestUnions", val.NestedUnion.SzText); - string ret = CLI.CLI.StructWithNestedUnionTestMethod(val); + string ret = CLI.CLICool.StructWithNestedUnionTestMethod(val); Assert.AreEqual("TestUnions", ret); } @@ -146,7 +146,7 @@ public void TestUnionWithNestedStructTestMethod() Assert.AreEqual(10, unionWithNestedStruct.NestedStruct.SzText.Length); Assert.AreEqual("TestUnions", unionWithNestedStruct.NestedStruct.SzText); - string ret = CLI.CLI.UnionWithNestedStructTestMethod(unionWithNestedStruct); + string ret = CLI.CLICool.UnionWithNestedStructTestMethod(unionWithNestedStruct); Assert.AreEqual("TestUnions", ret); } @@ -172,7 +172,7 @@ public void TestUnionWithNestedStructArrayTestMethod() Assert.AreEqual(2, unionWithNestedStructArray.NestedStructs.Length); - string ret = CLI.CLI.UnionWithNestedStructArrayTestMethod(unionWithNestedStructArray); + string ret = CLI.CLICool.UnionWithNestedStructArrayTestMethod(unionWithNestedStructArray); Assert.AreEqual("TestUnion1TestUnion2", ret); } diff --git a/tests/dotnet/CSharp/CSharp.CSharp.csproj b/tests/dotnet/CSharp/CSharp.CSharp.csproj index 6a6c4bf76a..23c154b115 100644 --- a/tests/dotnet/CSharp/CSharp.CSharp.csproj +++ b/tests/dotnet/CSharp/CSharp.CSharp.csproj @@ -1,6 +1,7 @@  0108 + 10 diff --git a/tests/dotnet/CSharp/CSharp.Gen.cs b/tests/dotnet/CSharp/CSharp.Gen.cs index 3e48a75914..5c9f45cef3 100644 --- a/tests/dotnet/CSharp/CSharp.Gen.cs +++ b/tests/dotnet/CSharp/CSharp.Gen.cs @@ -26,6 +26,8 @@ public override void Setup(Driver driver) driver.ParserOptions.UnityBuild = true; driver.ParserOptions.AddSupportedFunctionTemplates("FunctionTemplate"); + + driver.Options.GenerateFreeStandingFunctionsClassName = t => t.FileNameWithoutExtension + "Cool"; } public override void SetupPasses(Driver driver) @@ -118,17 +120,17 @@ public override bool VisitFunctionDecl(Function function) [TypeMap("boolean_t")] public class BooleanTypeMap : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new BuiltinType(PrimitiveType.Bool); } - public override void CSharpMarshalToNative(CSharpMarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { ctx.Return.Write(ctx.Parameter.Name); } - public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { ctx.Return.Write(ctx.ReturnVarName); } @@ -142,12 +144,12 @@ public override string CSharpConstruct() return string.Empty; } - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return GetEnumType(ctx.Type); } - public override void CSharpMarshalToNative(CSharpMarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { if (ctx.Parameter.Type.Desugar().IsAddress()) ctx.Return.Write("new global::System.IntPtr(&{0})", ctx.Parameter.Name); @@ -155,7 +157,7 @@ public override void CSharpMarshalToNative(CSharpMarshalContext ctx) ctx.Return.Write(ctx.Parameter.Name); } - public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { if (ctx.ReturnType.Type.Desugar().IsAddress()) { @@ -194,17 +196,17 @@ public override string CSharpConstruct() return string.Empty; } - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { return new TagType(flags ?? (flags = Context.ASTContext.FindEnum("Flags").First())); } - public override void CSharpMarshalToNative(CSharpMarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { ctx.Return.Write(ctx.Parameter.Name); } - public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { ctx.Return.Write(ctx.ReturnVarName); } @@ -227,7 +229,7 @@ public override bool IsIgnored } } - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { if (ctx.Kind == TypePrinterContextKind.Native) { @@ -247,7 +249,7 @@ public override Type CSharpSignatureType(TypePrinterContext ctx) ctx.GetTemplateParameterList()}>"); } - public override void CSharpMarshalToNative(CSharpMarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { // pointless, put just so that the generated code compiles var type = (TemplateSpecializationType)ctx.Parameter.Type.Desugar(); @@ -257,7 +259,7 @@ public override void CSharpMarshalToNative(CSharpMarshalContext ctx) ctx.Return.Write("new {0}()", specialization.Visit(typePrinter)); } - public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { ctx.Return.Write(ctx.ReturnVarName); } @@ -266,18 +268,18 @@ public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) [TypeMap("TypeMappedWithOperator")] public class TypeMappedWithOperator : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { // doesn't matter, we just need it to compile return new BuiltinType(PrimitiveType.Int); } - public override void CSharpMarshalToNative(CSharpMarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { ctx.Return.Write(ctx.Parameter.Name); } - public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { ctx.Return.Write(ctx.ReturnVarName); } @@ -286,7 +288,7 @@ public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) [TypeMap("QString")] public class QString : TypeMap { - public override Type CSharpSignatureType(TypePrinterContext ctx) + public override Type SignatureType(TypePrinterContext ctx) { if (ctx.Kind == TypePrinterContextKind.Native) { @@ -297,13 +299,13 @@ public override Type CSharpSignatureType(TypePrinterContext ctx) return new CILType(typeof(string)); } - public override void CSharpMarshalToNative(CSharpMarshalContext ctx) + public override void MarshalToNative(MarshalContext ctx) { ctx.Return.Write(ctx.Parameter.Type.Desugar().IsAddress() ? "global::System.IntPtr.Zero" : "\"test\""); } - public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) + public override void MarshalToManaged(MarshalContext ctx) { ctx.Return.Write("\"test\""); } diff --git a/tests/dotnet/CSharp/CSharp.Tests.cs b/tests/dotnet/CSharp/CSharp.Tests.cs index d35eb6ff70..f61e97ef62 100644 --- a/tests/dotnet/CSharp/CSharp.Tests.cs +++ b/tests/dotnet/CSharp/CSharp.Tests.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Reflection; using System.Runtime.InteropServices; -using System.Text; using CSharp; using NUnit.Framework; @@ -86,9 +85,9 @@ public void TestUncompilableCode() { } - CSharp.CSharp.FunctionInsideInlineNamespace(); - CSharp.CSharp.TakeMappedEnum(TestFlag.Flag1); - using (CSharpTemplates.SpecialiseReturnOnly()) + CSharp.CSharpCool.FunctionInsideInlineNamespace(); + CSharp.CSharpCool.TakeMappedEnum(TestFlag.Flag1); + using (CSharpTemplatesCool.SpecialiseReturnOnly()) { } @@ -128,16 +127,16 @@ public void TestDer() [Ignore("https://github.com/mono/CppSharp/issues/1518")] public void TestReturnCharPointer() { - Assert.That(new IntPtr(CSharp.CSharp.ReturnCharPointer()), Is.EqualTo(IntPtr.Zero)); + Assert.That(new IntPtr(CSharp.CSharpCool.ReturnCharPointer()), Is.EqualTo(IntPtr.Zero)); const char z = 'z'; - Assert.That(*CSharp.CSharp.TakeConstCharRef(z), Is.EqualTo(z)); + Assert.That(*CSharp.CSharpCool.TakeConstCharRef(z), Is.EqualTo(z)); } [Test] public void TestTakeCharPointer() { char c = 'c'; - Assert.That(*CSharp.CSharp.TakeCharPointer(&c), Is.EqualTo(c)); + Assert.That(*CSharp.CSharpCool.TakeCharPointer(&c), Is.EqualTo(c)); } [Test] @@ -347,16 +346,16 @@ public void TestDefaultArguments() methodsWithDefaultValues.DefaultOverloadedImplicitCtor(); methodsWithDefaultValues.DefaultWithParamNamedSameAsMethod(5); Assert.That(methodsWithDefaultValues.DefaultIntAssignedAnEnumWithBinaryOperatorAndFlags(), Is.EqualTo((int)(Bar.Items.Item1 | Bar.Items.Item2))); - Assert.That(methodsWithDefaultValues.DefaultWithConstantFlags(), Is.EqualTo(CSharp.CSharp.ConstFlag1 | CSharp.CSharp.ConstFlag2 | CSharp.CSharp.ConstFlag3)); + Assert.That(methodsWithDefaultValues.DefaultWithConstantFlags(), Is.EqualTo(CSharp.CSharpCool.ConstFlag1 | CSharp.CSharpCool.ConstFlag2 | CSharp.CSharpCool.ConstFlag3)); Assert.IsTrue(methodsWithDefaultValues.DefaultWithPointerToEnum()); - Assert.AreEqual(CSharp.CSharp.DefaultSmallPODInstance.__Instance, methodsWithDefaultValues.DefaultWithNonPrimitiveType().__Instance); + Assert.AreEqual(CSharp.CSharpCool.DefaultSmallPODInstance.__Instance, methodsWithDefaultValues.DefaultWithNonPrimitiveType().__Instance); } } [Test] public void TestGenerationOfAnotherUnitInSameFile() { - AnotherUnit.FunctionInAnotherUnit(); + AnotherUnitCool.FunctionInAnotherUnit(); } [Test] @@ -711,9 +710,9 @@ public unsafe void TestSizeOfDerivesFromTemplateInstantiation() public void TestReferenceToArrayWithConstSize() { int[] incorrectlySizedArray = { 1 }; - Assert.Catch(() => CSharp.CSharp.PassConstantArrayRef(incorrectlySizedArray)); + Assert.Catch(() => CSharp.CSharpCool.PassConstantArrayRef(incorrectlySizedArray)); int[] array = { 1, 2 }; - var result = CSharp.CSharp.PassConstantArrayRef(array); + var result = CSharp.CSharpCool.PassConstantArrayRef(array); Assert.That(result, Is.EqualTo(array[0])); } @@ -783,9 +782,9 @@ public void TestGetEnumFromNativePointer() [Test] public void TestStdStringConstant() { - Assert.That(CSharp.HasFreeConstant.AnotherUnit.STD_STRING_CONSTANT, Is.EqualTo("test")); + Assert.That(CSharp.HasFreeConstant.AnotherUnitCool.STD_STRING_CONSTANT, Is.EqualTo("test")); // check a second time to ensure it hasn't been improperly freed - Assert.That(CSharp.HasFreeConstant.AnotherUnit.STD_STRING_CONSTANT, Is.EqualTo("test")); + Assert.That(CSharp.HasFreeConstant.AnotherUnitCool.STD_STRING_CONSTANT, Is.EqualTo("test")); } [Test] @@ -843,10 +842,10 @@ public void TestAlignment() } foreach (var (type, offsets) in new (Type, uint[])[] { - (typeof(ClassCustomTypeAlignment), CSharp.CSharp.ClassCustomTypeAlignmentOffsets), - (typeof(ClassCustomObjectAlignment), CSharp.CSharp.ClassCustomObjectAlignmentOffsets), - (typeof(ClassMicrosoftObjectAlignment), CSharp.CSharp.ClassMicrosoftObjectAlignmentOffsets), - (typeof(StructWithEmbeddedArrayOfStructObjectAlignment), CSharp.CSharp.StructWithEmbeddedArrayOfStructObjectAlignmentOffsets), + (typeof(ClassCustomTypeAlignment), CSharp.CSharpCool.ClassCustomTypeAlignmentOffsets), + (typeof(ClassCustomObjectAlignment), CSharp.CSharpCool.ClassCustomObjectAlignmentOffsets), + (typeof(ClassMicrosoftObjectAlignment), CSharp.CSharpCool.ClassMicrosoftObjectAlignmentOffsets), + (typeof(StructWithEmbeddedArrayOfStructObjectAlignment), CSharp.CSharpCool.StructWithEmbeddedArrayOfStructObjectAlignmentOffsets), }) { var internalType = type.GetNestedType("__Internal"); @@ -885,10 +884,10 @@ public void TestClassSize() [Test] public void TestConstantArray() { - Assert.That(CSharp.CSharp.VariableWithFixedPrimitiveArray[0], Is.EqualTo(5)); - Assert.That(CSharp.CSharp.VariableWithFixedPrimitiveArray[1], Is.EqualTo(10)); - Assert.That(CSharp.CSharp.VariableWithVariablePrimitiveArray[0], Is.EqualTo(15)); - Assert.That(CSharp.CSharp.VariableWithVariablePrimitiveArray[1], Is.EqualTo(20)); + Assert.That(CSharp.CSharpCool.VariableWithFixedPrimitiveArray[0], Is.EqualTo(5)); + Assert.That(CSharp.CSharpCool.VariableWithFixedPrimitiveArray[1], Is.EqualTo(10)); + Assert.That(CSharp.CSharpCool.VariableWithVariablePrimitiveArray[0], Is.EqualTo(15)); + Assert.That(CSharp.CSharpCool.VariableWithVariablePrimitiveArray[1], Is.EqualTo(20)); } [Test] @@ -1490,17 +1489,17 @@ public override Flags HasPointerToEnumInParam(Flags pointerToEnum) [Test] public void TestGenerationOfIncompleteClasses() { - var incompleteStruct = CSharp.CSharp.CreateIncompleteStruct(); + var incompleteStruct = CSharp.CSharpCool.CreateIncompleteStruct(); Assert.IsNotNull(incompleteStruct); - Assert.DoesNotThrow(() => CSharp.CSharp.UseIncompleteStruct(incompleteStruct)); + Assert.DoesNotThrow(() => CSharp.CSharpCool.UseIncompleteStruct(incompleteStruct)); } [Test] public void TestForwardDeclaredStruct() { - using (var forwardDeclaredStruct = CSharp.CSharp.CreateForwardDeclaredStruct(10)) + using (var forwardDeclaredStruct = CSharp.CSharpCool.CreateForwardDeclaredStruct(10)) { - var i = CSharp.CSharp.UseForwardDeclaredStruct(forwardDeclaredStruct); + var i = CSharp.CSharpCool.UseForwardDeclaredStruct(forwardDeclaredStruct); Assert.AreEqual(forwardDeclaredStruct.I, i); } } @@ -1508,8 +1507,8 @@ public void TestForwardDeclaredStruct() [Test, Ignore("The Linux CI (alone) failes to generate these functions.")] public void TestDuplicateDeclaredIncompleteStruct() { - //var duplicateDeclaredIncompleteStruct = CSharp.CSharp.CreateDuplicateDeclaredStruct(10); - //var i = CSharp.CSharp.UseDuplicateDeclaredStruct(duplicateDeclaredIncompleteStruct); + //var duplicateDeclaredIncompleteStruct = CSharp.CSharpCool.CreateDuplicateDeclaredStruct(10); + //var i = CSharp.CSharpCool.UseDuplicateDeclaredStruct(duplicateDeclaredIncompleteStruct); //Assert.AreEqual(10, i); } @@ -1685,7 +1684,7 @@ public void TestVoidPtrReturningIndexer() public void TestFuncWithTypedefedFuncPtrAsParam() { TypedefedFuncPtr function = (a, b) => 5; - Assert.That(CSharp.CSharp.FuncWithTypedefedFuncPtrAsParam(function), Is.EqualTo(5)); + Assert.That(CSharp.CSharpCool.FuncWithTypedefedFuncPtrAsParam(function), Is.EqualTo(5)); } [Test] @@ -1770,14 +1769,14 @@ public void TestVirtualIndirectCallInNative() [Test] public void TestConstCharStarRef() { - Assert.That(CSharp.CSharp.TakeConstCharStarRef("Test"), Is.EqualTo("Test")); + Assert.That(CSharp.CSharpCool.TakeConstCharStarRef("Test"), Is.EqualTo("Test")); } [Test] public void TestRValueReferenceToPointer() { int value = 5; - IntPtr intPtr = CSharp.CSharp.RValueReferenceToPointer((IntPtr*)&value); + IntPtr intPtr = CSharp.CSharpCool.RValueReferenceToPointer((IntPtr*)&value); Assert.That((int)intPtr, Is.EqualTo(value)); } @@ -1786,7 +1785,7 @@ public void TakeRefToPointerToObject() { using (Foo foo = new Foo { A = 25 }) { - Foo returnedFoo = CSharp.CSharp.TakeReturnReferenceToPointer(foo); + Foo returnedFoo = CSharp.CSharpCool.TakeReturnReferenceToPointer(foo); Assert.That(returnedFoo.A, Is.EqualTo(foo.A)); using (Qux qux = new Qux()) { @@ -1833,7 +1832,7 @@ private class OverrideVirtualTemplate : VirtualTemplate [Test] public void TestTypemapTypedefParam() { - Assert.That(CSharp.CSharp.TakeTypemapTypedefParam(false), Is.False); + Assert.That(CSharp.CSharpCool.TakeTypemapTypedefParam(false), Is.False); } [Test] @@ -1867,13 +1866,13 @@ public void TestStringMarshall() foreach (var @string in strings) { var cs = @string; - Assert.That(CSharp.CSharp.TestCSharpString(cs, out var @out), Is.EqualTo(cs)); + Assert.That(CSharp.CSharpCool.TestCSharpString(cs, out var @out), Is.EqualTo(cs)); Assert.That(@out, Is.EqualTo(cs)); - Assert.That(CSharp.CSharp.TestCSharpStringWide(cs, out var outWide), Is.EqualTo(cs)); + Assert.That(CSharp.CSharpCool.TestCSharpStringWide(cs, out var outWide), Is.EqualTo(cs)); Assert.That(outWide, Is.EqualTo(cs)); - Assert.That(CSharp.CSharp.TestCSharpString16(cs, out var out16), Is.EqualTo(cs)); + Assert.That(CSharp.CSharpCool.TestCSharpString16(cs, out var out16), Is.EqualTo(cs)); Assert.That(out16, Is.EqualTo(cs)); - Assert.That(CSharp.CSharp.TestCSharpString32(cs, out var out32), Is.EqualTo(cs)); + Assert.That(CSharp.CSharpCool.TestCSharpString32(cs, out var out32), Is.EqualTo(cs)); Assert.That(out32, Is.EqualTo(cs)); } } @@ -1891,11 +1890,11 @@ public void TestConversionFunction() [Test] public void TestFunctionToStaticMethod() { - Assert.That(CSharp.CSharp.TestFunctionToStaticMethod(new FTIStruct()).A, Is.EqualTo(6)); - Assert.That(CSharp.CSharp.TestFunctionToStaticMethodStruct(new FTIStruct(), new FTIStruct() { A = 6 }), Is.EqualTo(6)); - Assert.That(CSharp.CSharp.TestFunctionToStaticMethodRefStruct(new FTIStruct(), new FTIStruct() { A = 6 }), Is.EqualTo(6)); - Assert.That(CSharp.CSharp.TestFunctionToStaticMethodConstStruct(new FTIStruct(), new FTIStruct() { A = 6 }), Is.EqualTo(6)); - Assert.That(CSharp.CSharp.TestFunctionToStaticMethodConstRefStruct(new FTIStruct(), new FTIStruct() { A = 6 }), Is.EqualTo(6)); + Assert.That(CSharp.CSharpCool.TestFunctionToStaticMethod(new FTIStruct()).A, Is.EqualTo(6)); + Assert.That(CSharp.CSharpCool.TestFunctionToStaticMethodStruct(new FTIStruct(), new FTIStruct() { A = 6 }), Is.EqualTo(6)); + Assert.That(CSharp.CSharpCool.TestFunctionToStaticMethodRefStruct(new FTIStruct(), new FTIStruct() { A = 6 }), Is.EqualTo(6)); + Assert.That(CSharp.CSharpCool.TestFunctionToStaticMethodConstStruct(new FTIStruct(), new FTIStruct() { A = 6 }), Is.EqualTo(6)); + Assert.That(CSharp.CSharpCool.TestFunctionToStaticMethodConstRefStruct(new FTIStruct(), new FTIStruct() { A = 6 }), Is.EqualTo(6)); } [Test] @@ -1915,9 +1914,9 @@ public bool TestClassGenerateNativeToManaged(Type type) [Test] public void TestFunctionTemplate() { - Assert.That(CSharpTemplates.FunctionTemplate(5.0), Is.EqualTo(5 + 4.2)); - Assert.That(CSharpTemplates.FunctionTemplate(6f), Is.EqualTo(6 + 4.1f)); - Assert.That(CSharpTemplates.FunctionTemplate(7), Is.EqualTo(7 + 4)); + Assert.That(CSharpTemplatesCool.FunctionTemplate(5.0), Is.EqualTo(5 + 4.2)); + Assert.That(CSharpTemplatesCool.FunctionTemplate(6f), Is.EqualTo(6 + 4.1f)); + Assert.That(CSharpTemplatesCool.FunctionTemplate(7), Is.EqualTo(7 + 4)); } [Test] @@ -1927,11 +1926,11 @@ public void TestPatialRefSupport() var backup = myclass; myclass.Value = 7; - CSharp.CSharp.ModifyCore(ref myclass); + CSharp.CSharpCool.ModifyCore(ref myclass); Assert.That(myclass.Value, Is.EqualTo(10)); Assert.That(myclass, Is.SameAs(myclass)); - CSharp.CSharp.CreateCore(ref myclass); + CSharp.CSharpCool.CreateCore(ref myclass); Assert.That(myclass.Value, Is.EqualTo(20)); Assert.That(myclass, Is.Not.SameAs(backup)); } @@ -1955,7 +1954,7 @@ public void TestCallByValueCppToCSharpValue() { RuleOfThreeTester.Reset(); CallByValueInterface @interface = new CallByValueInterfaceImpl(); - CSharp.CSharp.CallCallByValueInterfaceValue(@interface); + CSharp.CSharpCool.CallCallByValueInterfaceValue(@interface); Assert.That(RuleOfThreeTester.ConstructorCalls, Is.EqualTo(1)); Assert.That(RuleOfThreeTester.DestructorCalls, Is.EqualTo(2)); @@ -1968,7 +1967,7 @@ public void TestCallByValueCppToCSharpReference() { RuleOfThreeTester.Reset(); CallByValueInterface @interface = new CallByValueInterfaceImpl(); - CSharp.CSharp.CallCallByValueInterfaceReference(@interface); + CSharp.CSharpCool.CallCallByValueInterfaceReference(@interface); Assert.That(RuleOfThreeTester.ConstructorCalls, Is.EqualTo(1)); Assert.That(RuleOfThreeTester.DestructorCalls, Is.EqualTo(1)); @@ -1981,7 +1980,7 @@ public void TestCallByValueCppToCSharpPointer() { RuleOfThreeTester.Reset(); CallByValueInterface @interface = new CallByValueInterfaceImpl(); - CSharp.CSharp.CallCallByValueInterfacePointer(@interface); + CSharp.CSharpCool.CallCallByValueInterfacePointer(@interface); Assert.That(RuleOfThreeTester.ConstructorCalls, Is.EqualTo(1)); Assert.That(RuleOfThreeTester.DestructorCalls, Is.EqualTo(1)); @@ -1992,7 +1991,76 @@ public void TestCallByValueCppToCSharpPointer() [Test] public void TestPointerToClass() { - Assert.IsTrue(CSharp.CSharp.PointerToClass.IsDefaultInstance); - Assert.IsTrue(CSharp.CSharp.PointerToClass.IsValid); + Assert.IsTrue(CSharp.CSharpCool.PointerToClass.IsDefaultInstance); + Assert.IsTrue(CSharp.CSharpCool.PointerToClass.IsValid); + } + + [Test] + public void TestValueTypeOutParameter() + { + Assert.AreEqual(2, CSharp.CSharpCool.ValueTypeOutParameter(out var unionTestA, out var unionTestB)); + Assert.AreEqual(2, unionTestA.A); + Assert.AreEqual(2, unionTestB.B); + } + + [TestCase("hi")] + [TestCase(2u)] + public void TestOptional(T value) + { + Assert.That(new CSharp.Optional() != new CSharp.Optional(value)); + Assert.That(new CSharp.Optional() != value); + Assert.That(new CSharp.Optional() == new CSharp.Optional()); + Assert.That(new CSharp.Optional(value) == new CSharp.Optional(value)); + Assert.That(new CSharp.Optional(value) == value); + } + + [Test] + public void TestOptionalIntPtr() + { + Assert.That(new CSharp.Optional() != new CSharp.Optional(IntPtr.MaxValue)); + Assert.That(new CSharp.Optional() != IntPtr.MaxValue); + Assert.That(new CSharp.Optional() == new CSharp.Optional()); + Assert.That(new CSharp.Optional(IntPtr.MaxValue) == new CSharp.Optional(IntPtr.MaxValue)); + Assert.That(new CSharp.Optional(IntPtr.MaxValue) == IntPtr.MaxValue); + } + + [Test] + public void TestValueTypeStringMember() + { + var test = new CSharp.ValueType(); + Assert.AreEqual(string.Empty, test.StringMember); + Assert.AreEqual(null, test.CharPtrMember); + test.StringMember = "test"; + test.CharPtrMember = "test2"; + Assert.AreEqual("test", test.StringMember); + Assert.AreEqual("test2", test.CharPtrMember); + test.Dispose(); + } + + [Test] + [Ignore("https://github.com/mono/CppSharp/issues/1786")] + public void TestValueTypeStringMemberDefaulted() + { + CSharp.ValueType test = default; + Assert.AreEqual(string.Empty, test.StringMember); + Assert.AreEqual(null, test.CharPtrMember); + test.StringMember = "test"; + test.CharPtrMember = "test2"; + Assert.AreEqual("test", test.StringMember); + Assert.AreEqual("test2", test.CharPtrMember); + test.Dispose(); + } + + [Test] + public void TestValueTypeStringMemberDefaultedCtor() + { + var test = new CSharp.ValueTypeNoCtor(); + Assert.AreEqual(string.Empty, test.StringMember); + Assert.AreEqual(null, test.CharPtrMember); + test.StringMember = "test"; + test.CharPtrMember = "test2"; + Assert.AreEqual("test", test.StringMember); + Assert.AreEqual("test2", test.CharPtrMember); + test.Dispose(); } } diff --git a/tests/dotnet/CSharp/CSharp.cpp b/tests/dotnet/CSharp/CSharp.cpp index cffbff4bd7..9a8beb618c 100644 --- a/tests/dotnet/CSharp/CSharp.cpp +++ b/tests/dotnet/CSharp/CSharp.cpp @@ -1791,3 +1791,10 @@ bool PointerTester::IsValid() } PointerTester* PointerToClass = &internalPointerTesterInstance; + +int ValueTypeOutParameter(UnionTester* testerA, UnionTester* testerB) +{ + testerA->a = 2; + testerB->b = 2; + return 2; +} diff --git a/tests/dotnet/CSharp/CSharp.h b/tests/dotnet/CSharp/CSharp.h index 504dd7e2cc..885244693a 100644 --- a/tests/dotnet/CSharp/CSharp.h +++ b/tests/dotnet/CSharp/CSharp.h @@ -733,22 +733,22 @@ class DLL_API TestParamToInterfacePassBaseOne class DLL_API TestParamToInterfacePassBaseTwo { - int m; + int m; public: - int getM(); - void setM(int n); - const TestParamToInterfacePassBaseTwo& operator++(); - TestParamToInterfacePassBaseTwo(); - TestParamToInterfacePassBaseTwo(int n); + int getM(); + void setM(int n); + const TestParamToInterfacePassBaseTwo& operator++(); + TestParamToInterfacePassBaseTwo(); + TestParamToInterfacePassBaseTwo(int n); }; class DLL_API TestParamToInterfacePass : public TestParamToInterfacePassBaseOne, public TestParamToInterfacePassBaseTwo { public: - TestParamToInterfacePassBaseTwo addM(TestParamToInterfacePassBaseTwo b); - TestParamToInterfacePassBaseTwo operator+(TestParamToInterfacePassBaseTwo b); - TestParamToInterfacePass(TestParamToInterfacePassBaseTwo b); - TestParamToInterfacePass(); + TestParamToInterfacePassBaseTwo addM(TestParamToInterfacePassBaseTwo b); + TestParamToInterfacePassBaseTwo operator+(TestParamToInterfacePassBaseTwo b); + TestParamToInterfacePass(TestParamToInterfacePassBaseTwo b); + TestParamToInterfacePass(); }; class DLL_API HasProtectedVirtual @@ -973,18 +973,18 @@ class DLL_API ClassWithVirtualBase : public virtual Foo namespace NamespaceA { - CS_VALUE_TYPE class DLL_API A - { - }; + CS_VALUE_TYPE class DLL_API A + { + }; } namespace NamespaceB { - class DLL_API B - { - public: - void Function(CS_OUT NamespaceA::A &a); - }; + class DLL_API B + { + public: + void Function(CS_OUT NamespaceA::A &a); + }; } class DLL_API HasPrivateVirtualProperty @@ -1603,3 +1603,55 @@ class DLL_API PointerTester }; DLL_API extern PointerTester* PointerToClass; + +union DLL_API UnionTester { + float a; + int b; + inline bool operator ==(const UnionTester& other) const { + return b == other.b; + } +}; + +int DLL_API ValueTypeOutParameter(CS_OUT UnionTester* testerA, CS_OUT UnionTester* testerB); + +template +class Optional { +public: + T m_value; + bool m_hasValue; + + Optional() { + m_hasValue = false; + } + + Optional(T value) { + m_value = std::move(value); + m_hasValue = true; + } + + inline bool operator ==(const Optional& rhs) const { + return (m_hasValue == rhs.m_hasValue && (!m_hasValue || m_value == rhs.m_value)); + } + + inline bool operator ==(const T& rhs) const { + return (m_hasValue && m_value == rhs); + } +}; + +// We just need a method that uses various instantiations of Optional. +inline void DLL_API InstantiateOptionalTemplate(Optional, Optional, + Optional, Optional, Optional) { } + +CS_VALUE_TYPE class DLL_API ValueType { +public: + ValueType() { } + + std::string string_member; + const char* char_ptr_member; +}; + +CS_VALUE_TYPE class DLL_API ValueTypeNoCtor { +public: + std::string string_member; + const char* char_ptr_member; +}; diff --git a/tests/dotnet/Common/Common.CSharp.csproj b/tests/dotnet/Common/Common.CSharp.csproj index a6968989f3..ab697a82e1 100644 --- a/tests/dotnet/Common/Common.CSharp.csproj +++ b/tests/dotnet/Common/Common.CSharp.csproj @@ -1 +1,5 @@ - \ No newline at end of file + + + 11.0 + + \ No newline at end of file diff --git a/tests/dotnet/Common/Common.Gen.cs b/tests/dotnet/Common/Common.Gen.cs index 0f1c47d10f..08bf971f1c 100644 --- a/tests/dotnet/Common/Common.Gen.cs +++ b/tests/dotnet/Common/Common.Gen.cs @@ -7,37 +7,47 @@ namespace CppSharp.Tests { - [TypeMap("TypeMappedIndex")] - public class TypeMappedIndex : TypeMap + namespace CLI { - public override Type CLISignatureType(TypePrinterContext ctx) + [TypeMap("TypeMappedIndex", GeneratorKindID = GeneratorKind.CLI_ID)] + public class TypeMappedIndex : TypeMap { - return new BuiltinType(PrimitiveType.UShort); - } - - public override void CLIMarshalToManaged(MarshalContext ctx) - { - ctx.Return.Write(ctx.ReturnVarName); - } - - public override void CLIMarshalToNative(MarshalContext ctx) - { - ctx.Return.Write("::TypeMappedIndex()"); - } - - public override Type CSharpSignatureType(TypePrinterContext ctx) - { - return new BuiltinType(PrimitiveType.UShort); - } - - public override void CSharpMarshalToManaged(CSharpMarshalContext ctx) - { - ctx.Return.Write(ctx.ReturnVarName); + public override Type SignatureType(TypePrinterContext ctx) + { + return new BuiltinType(PrimitiveType.UShort); + } + + public override void MarshalToManaged(MarshalContext ctx) + { + ctx.Return.Write(ctx.ReturnVarName); + } + + public override void MarshalToNative(MarshalContext ctx) + { + ctx.Return.Write("::TypeMappedIndex()"); + } } + } - public override void CSharpMarshalToNative(CSharpMarshalContext ctx) + namespace CSharp + { + [TypeMap("TypeMappedIndex", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class TypeMappedIndex : TypeMap { - ctx.Return.Write("IntPtr.Zero"); + public override Type SignatureType(TypePrinterContext ctx) + { + return new BuiltinType(PrimitiveType.UShort); + } + + public override void MarshalToManaged(MarshalContext ctx) + { + ctx.Return.Write(ctx.ReturnVarName); + } + + public override void MarshalToNative(MarshalContext ctx) + { + ctx.Return.Write("IntPtr.Zero"); + } } } diff --git a/tests/dotnet/Native/AST.h b/tests/dotnet/Native/AST.h index 29ff076283..1ec43910ab 100644 --- a/tests/dotnet/Native/AST.h +++ b/tests/dotnet/Native/AST.h @@ -190,4 +190,13 @@ class HasMethods { public: void isVolatileMethod() volatile {} -}; \ No newline at end of file +}; + +template +class TestClassTemplatePartialSpecialization +{ +}; +template +class TestClassTemplatePartialSpecialization +{ +}; diff --git a/version.json b/version.json index 0ea35b1b9c..2bb9c8afc5 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.0", + "version": "1.1", "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/tags/v\\d\\.\\d"