diff --git a/src/AST/Template.cs b/src/AST/Template.cs index e71ee5b81..57cd5c7dc 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/CppParser/AST.cpp b/src/CppParser/AST.cpp index b01cb8deb..1b33cdb8c 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 6afab65ea..58553e540 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 cfc54e856..107a2aefc 100644 --- a/src/CppParser/Bindings/CLI/Decl.h +++ b/src/CppParser/Bindings/CLI/Decl.h @@ -2205,6 +2205,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 2a5e810ff..2f075705a 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 @@ -13779,7 +13779,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; @@ -13834,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); @@ -13843,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) @@ -13923,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 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 110662ddb..80f6d22dd 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 @@ -13779,7 +13779,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; @@ -13834,6 +13834,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); @@ -13843,6 +13844,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) @@ -13923,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 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 66e101cbb..5f7e6c23c 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 @@ -13778,7 +13778,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; @@ -13833,6 +13833,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); @@ -13842,6 +13843,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) @@ -13922,6 +13935,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 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 95c942de4..c4efef79d 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 @@ -13778,7 +13778,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; @@ -13833,6 +13833,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); @@ -13842,6 +13843,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) @@ -13922,6 +13935,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 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 3799d088f..1aec7530f 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 @@ -13778,7 +13778,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; @@ -13833,6 +13833,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); @@ -13842,6 +13843,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) @@ -13922,6 +13935,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 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 7664bbf6d..c626a8ec5 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 @@ -13780,7 +13780,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; @@ -13835,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@@QEAA@XZ", CallingConvention = __CallingConvention.Cdecl)] internal static extern __IntPtr ctor(__IntPtr __instance); @@ -13844,6 +13845,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) @@ -13924,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 diff --git a/src/CppParser/Decl.h b/src/CppParser/Decl.h index 40a2128bb..e8665ca7d 100644 --- a/src/CppParser/Decl.h +++ b/src/CppParser/Decl.h @@ -715,6 +715,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 8821ae03e..06b39aa12 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -1339,6 +1339,8 @@ Parser::WalkClassTemplatePartialSpecialization(const clang::ClassTemplatePartial } } + TS->Parameters = WalkTemplateParameterList(CTS->getTemplateParameters()); + return TS; } diff --git a/src/Generator.Tests/AST/TestAST.cs b/src/Generator.Tests/AST/TestAST.cs index b04a6f0c9..62a0f6d9f 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/Parser/ASTConverter.cs b/src/Parser/ASTConverter.cs index 1c03e9390..ea827d097 100644 --- a/src/Parser/ASTConverter.cs +++ b/src/Parser/ASTConverter.cs @@ -1918,6 +1918,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/Native/AST.h b/tests/dotnet/Native/AST.h index 29ff07628..1ec43910a 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 +{ +};