Browse Source

Wrapped injected classes in order to ease binding lists of redeclarations.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/812/head
realvictorprm 8 years ago committed by Dimitar Dobrev
parent
commit
9d89764965
  1. 2
      src/AST/Class.cs
  2. 1
      src/CppParser/AST.cpp
  3. 1
      src/CppParser/AST.h
  4. 10
      src/CppParser/Bindings/CLI/AST.cpp
  5. 12
      src/CppParser/Bindings/CLI/AST.h
  6. 28
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs
  7. 28
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs
  8. 8
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Std.cs
  9. 28
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs
  10. 8
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs
  11. 28
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs
  12. 18
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std.cs
  13. 28
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs
  14. 14
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std.cs
  15. 28
      src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs
  16. 10
      src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std.cs
  17. 4
      src/CppParser/Parser.cpp
  18. 2
      src/Generator/Generators/CSharp/CSharpSources.cs
  19. 21
      src/Generator/Passes/CheckIgnoredDecls.cs
  20. 5
      src/Parser/ASTConverter.cs

2
src/AST/Class.cs

@ -98,6 +98,8 @@ namespace CppSharp.AST @@ -98,6 +98,8 @@ namespace CppSharp.AST
private bool? isOpaque = null;
public bool IsInjected { get; set; }
// True if the type is to be treated as opaque.
public bool IsOpaque
{

1
src/CppParser/AST.cpp

@ -723,6 +723,7 @@ Class::Class() @@ -723,6 +723,7 @@ Class::Class()
, hasNonTrivialCopyConstructor(false)
, hasNonTrivialDestructor(false)
, isExternCContext(false)
, isInjected(false)
, layout(0)
{
}

1
src/CppParser/AST.h

@ -862,6 +862,7 @@ public: @@ -862,6 +862,7 @@ public:
bool hasNonTrivialCopyConstructor;
bool hasNonTrivialDestructor;
bool isExternCContext;
bool isInjected;
ClassLayout* layout;
};

10
src/CppParser/Bindings/CLI/AST.cpp

@ -3944,6 +3944,16 @@ void CppSharp::Parser::AST::Class::IsExternCContext::set(bool value) @@ -3944,6 +3944,16 @@ void CppSharp::Parser::AST::Class::IsExternCContext::set(bool value)
((::CppSharp::CppParser::AST::Class*)NativePtr)->isExternCContext = value;
}
bool CppSharp::Parser::AST::Class::IsInjected::get()
{
return ((::CppSharp::CppParser::AST::Class*)NativePtr)->isInjected;
}
void CppSharp::Parser::AST::Class::IsInjected::set(bool value)
{
((::CppSharp::CppParser::AST::Class*)NativePtr)->isInjected = value;
}
CppSharp::Parser::AST::ClassLayout^ CppSharp::Parser::AST::Class::Layout::get()
{
return (((::CppSharp::CppParser::AST::Class*)NativePtr)->layout == nullptr) ? nullptr : gcnew CppSharp::Parser::AST::ClassLayout((::CppSharp::CppParser::AST::ClassLayout*)((::CppSharp::CppParser::AST::Class*)NativePtr)->layout);

12
src/CppParser/Bindings/CLI/AST.h

@ -343,8 +343,8 @@ namespace CppSharp @@ -343,8 +343,8 @@ namespace CppSharp
Itanium = 0,
Microsoft = 1,
ARM = 2,
IOS = 3,
IOS64 = 4
iOS = 3,
iOS64 = 4
};
public enum struct VTableComponentKind
@ -405,7 +405,7 @@ namespace CppSharp @@ -405,7 +405,7 @@ namespace CppSharp
{
UnknownArch = 0,
X86 = 1,
X8664 = 2
X86_64 = 2
};
public ref class Type : ICppInstance
@ -2327,6 +2327,12 @@ namespace CppSharp @@ -2327,6 +2327,12 @@ namespace CppSharp
void set(bool);
}
property bool IsInjected
{
bool get();
void set(bool);
}
property CppSharp::Parser::AST::ClassLayout^ Layout
{
CppSharp::Parser::AST::ClassLayout^ get();

28
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs

@ -230,8 +230,8 @@ namespace CppSharp @@ -230,8 +230,8 @@ namespace CppSharp
Itanium = 0,
Microsoft = 1,
ARM = 2,
IOS = 3,
IOS64 = 4
iOS = 3,
iOS64 = 4
}
public enum VTableComponentKind
@ -292,7 +292,7 @@ namespace CppSharp @@ -292,7 +292,7 @@ namespace CppSharp
{
UnknownArch = 0,
X86 = 1,
X8664 = 2
X86_64 = 2
}
public unsafe partial class Type : IDisposable
@ -8907,6 +8907,9 @@ namespace CppSharp @@ -8907,6 +8907,9 @@ namespace CppSharp
[FieldOffset(272)]
public byte isExternCContext;
[FieldOffset(273)]
public byte isInjected;
[FieldOffset(276)]
public global::System.IntPtr layout;
@ -9283,6 +9286,19 @@ namespace CppSharp @@ -9283,6 +9286,19 @@ namespace CppSharp
}
}
public bool IsInjected
{
get
{
return ((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected != 0;
}
set
{
((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected = (byte) (value ? 1 : 0);
}
}
public global::CppSharp.Parser.AST.ClassLayout Layout
{
get
@ -10799,6 +10815,9 @@ namespace CppSharp @@ -10799,6 +10815,9 @@ namespace CppSharp
[FieldOffset(272)]
public byte isExternCContext;
[FieldOffset(273)]
public byte isInjected;
[FieldOffset(276)]
public global::System.IntPtr layout;
@ -11100,6 +11119,9 @@ namespace CppSharp @@ -11100,6 +11119,9 @@ namespace CppSharp
[FieldOffset(272)]
public byte isExternCContext;
[FieldOffset(273)]
public byte isInjected;
[FieldOffset(276)]
public global::System.IntPtr layout;

28
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppSharp.CppParser.cs

@ -230,8 +230,8 @@ namespace CppSharp @@ -230,8 +230,8 @@ namespace CppSharp
Itanium = 0,
Microsoft = 1,
ARM = 2,
IOS = 3,
IOS64 = 4
iOS = 3,
iOS64 = 4
}
public enum VTableComponentKind
@ -292,7 +292,7 @@ namespace CppSharp @@ -292,7 +292,7 @@ namespace CppSharp
{
UnknownArch = 0,
X86 = 1,
X8664 = 2
X86_64 = 2
}
public unsafe partial class Type : IDisposable
@ -8907,6 +8907,9 @@ namespace CppSharp @@ -8907,6 +8907,9 @@ namespace CppSharp
[FieldOffset(304)]
public byte isExternCContext;
[FieldOffset(305)]
public byte isInjected;
[FieldOffset(308)]
public global::System.IntPtr layout;
@ -9283,6 +9286,19 @@ namespace CppSharp @@ -9283,6 +9286,19 @@ namespace CppSharp
}
}
public bool IsInjected
{
get
{
return ((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected != 0;
}
set
{
((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected = (byte) (value ? 1 : 0);
}
}
public global::CppSharp.Parser.AST.ClassLayout Layout
{
get
@ -10799,6 +10815,9 @@ namespace CppSharp @@ -10799,6 +10815,9 @@ namespace CppSharp
[FieldOffset(304)]
public byte isExternCContext;
[FieldOffset(305)]
public byte isInjected;
[FieldOffset(308)]
public global::System.IntPtr layout;
@ -11100,6 +11119,9 @@ namespace CppSharp @@ -11100,6 +11119,9 @@ namespace CppSharp
[FieldOffset(304)]
public byte isExternCContext;
[FieldOffset(305)]
public byte isInjected;
[FieldOffset(308)]
public global::System.IntPtr layout;

8
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Std.cs

@ -63,7 +63,7 @@ namespace Std @@ -63,7 +63,7 @@ namespace Std
public unsafe partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="?eof@?$char_traits@D@std@@SAHXZ")]
internal static extern int Eofc__N_std_S_char_traits__C_0();
}
@ -477,7 +477,7 @@ namespace Std @@ -477,7 +477,7 @@ namespace Std
public unsafe partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??0?$allocator@D@std@@QAE@XZ")]
internal static extern global::System.IntPtr ctorc__N_std_S_allocator__C_0(global::System.IntPtr instance);
}
@ -568,12 +568,12 @@ namespace Std @@ -568,12 +568,12 @@ namespace Std
internal global::Std.CompressedPair.__Internalc__N_std_S__Compressed_pair____N_std_S__Wrap_alloc____N_std_S_allocator__C___N_std_S__String_val____N_std_S__Simple_types__C_Vb1 _Mypair;
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ")]
internal static extern void dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance, int delete);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ")]
internal static extern global::System.IntPtr CStrc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance);
}

28
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs

@ -230,8 +230,8 @@ namespace CppSharp @@ -230,8 +230,8 @@ namespace CppSharp
Itanium = 0,
Microsoft = 1,
ARM = 2,
IOS = 3,
IOS64 = 4
iOS = 3,
iOS64 = 4
}
public enum VTableComponentKind
@ -292,7 +292,7 @@ namespace CppSharp @@ -292,7 +292,7 @@ namespace CppSharp
{
UnknownArch = 0,
X86 = 1,
X8664 = 2
X86_64 = 2
}
public unsafe partial class Type : IDisposable
@ -8906,6 +8906,9 @@ namespace CppSharp @@ -8906,6 +8906,9 @@ namespace CppSharp
[FieldOffset(520)]
public byte isExternCContext;
[FieldOffset(521)]
public byte isInjected;
[FieldOffset(528)]
public global::System.IntPtr layout;
@ -9282,6 +9285,19 @@ namespace CppSharp @@ -9282,6 +9285,19 @@ namespace CppSharp
}
}
public bool IsInjected
{
get
{
return ((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected != 0;
}
set
{
((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected = (byte) (value ? 1 : 0);
}
}
public global::CppSharp.Parser.AST.ClassLayout Layout
{
get
@ -10798,6 +10814,9 @@ namespace CppSharp @@ -10798,6 +10814,9 @@ namespace CppSharp
[FieldOffset(520)]
public byte isExternCContext;
[FieldOffset(521)]
public byte isInjected;
[FieldOffset(528)]
public global::System.IntPtr layout;
@ -11099,6 +11118,9 @@ namespace CppSharp @@ -11099,6 +11118,9 @@ namespace CppSharp
[FieldOffset(520)]
public byte isExternCContext;
[FieldOffset(521)]
public byte isInjected;
[FieldOffset(528)]
public global::System.IntPtr layout;

8
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs

@ -153,7 +153,7 @@ namespace Std @@ -153,7 +153,7 @@ namespace Std
public unsafe partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__19allocatorIcEC2Ev")]
internal static extern void ctorc__N_std_N___1_S_allocator__C_0(global::System.IntPtr instance);
}
@ -1266,7 +1266,7 @@ namespace Std @@ -1266,7 +1266,7 @@ namespace Std
public unsafe partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__111char_traitsIcE3eofEv")]
internal static extern int Eofc__N_std_N___1_S_char_traits__C_0();
}
@ -1346,12 +1346,12 @@ namespace Std @@ -1346,12 +1346,12 @@ namespace Std
internal global::Std.__1.CompressedPair.__Internal __r_;
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev")]
internal static extern void dtorc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv")]
internal static extern global::System.IntPtr CStrc__N_std_N___1_S_basic_string__C___N_std_N___1_S_char_traits__C___N_std_N___1_S_allocator__C_0(global::System.IntPtr instance);
}

28
src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/CppSharp.CppParser.cs

@ -230,8 +230,8 @@ namespace CppSharp @@ -230,8 +230,8 @@ namespace CppSharp
Itanium = 0,
Microsoft = 1,
ARM = 2,
IOS = 3,
IOS64 = 4
iOS = 3,
iOS64 = 4
}
public enum VTableComponentKind
@ -292,7 +292,7 @@ namespace CppSharp @@ -292,7 +292,7 @@ namespace CppSharp
{
UnknownArch = 0,
X86 = 1,
X8664 = 2
X86_64 = 2
}
public unsafe partial class Type : IDisposable
@ -8906,6 +8906,9 @@ namespace CppSharp @@ -8906,6 +8906,9 @@ namespace CppSharp
[FieldOffset(568)]
public byte isExternCContext;
[FieldOffset(569)]
public byte isInjected;
[FieldOffset(576)]
public global::System.IntPtr layout;
@ -9282,6 +9285,19 @@ namespace CppSharp @@ -9282,6 +9285,19 @@ namespace CppSharp
}
}
public bool IsInjected
{
get
{
return ((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected != 0;
}
set
{
((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected = (byte) (value ? 1 : 0);
}
}
public global::CppSharp.Parser.AST.ClassLayout Layout
{
get
@ -10798,6 +10814,9 @@ namespace CppSharp @@ -10798,6 +10814,9 @@ namespace CppSharp
[FieldOffset(568)]
public byte isExternCContext;
[FieldOffset(569)]
public byte isInjected;
[FieldOffset(576)]
public global::System.IntPtr layout;
@ -11099,6 +11118,9 @@ namespace CppSharp @@ -11099,6 +11118,9 @@ namespace CppSharp
[FieldOffset(568)]
public byte isExternCContext;
[FieldOffset(569)]
public byte isInjected;
[FieldOffset(576)]
public global::System.IntPtr layout;

18
src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std.cs

@ -45,12 +45,12 @@ namespace Std @@ -45,12 +45,12 @@ namespace Std
public unsafe partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSaIcEC2Ev")]
internal static extern void ctorc__N_std_S_allocator__C_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSaIcED2Ev")]
internal static extern void dtorc__N_std_S_allocator__C_0(global::System.IntPtr instance);
}
@ -204,8 +204,8 @@ namespace Std @@ -204,8 +204,8 @@ namespace Std
{
public enum RbTreeColor : uint
{
SRed = 0,
SBlack = 1
S_red = 0,
S_black = 1
}
namespace RbTree
@ -340,7 +340,7 @@ namespace Std @@ -340,7 +340,7 @@ namespace Std
public unsafe partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt11char_traitsIcE3eofEv")]
internal static extern int Eofc__N_std_S_char_traits__C_0();
}
@ -657,19 +657,19 @@ namespace Std @@ -657,19 +657,19 @@ namespace Std
internal global::Std.Cxx11.BasicString._.__Internal _;
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev")]
internal static extern void dtorc__N_std_N___cxx11_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv")]
internal static extern global::System.IntPtr CStrc__N_std_N___cxx11_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance);
}
internal enum SLocalCapacity : uint
internal enum S_localCapacity : uint
{
SLocalCapacity = 15
S_localCapacity = 15
}
public unsafe partial class AllocHider

28
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppSharp.CppParser.cs

@ -230,8 +230,8 @@ namespace CppSharp @@ -230,8 +230,8 @@ namespace CppSharp
Itanium = 0,
Microsoft = 1,
ARM = 2,
IOS = 3,
IOS64 = 4
iOS = 3,
iOS64 = 4
}
public enum VTableComponentKind
@ -292,7 +292,7 @@ namespace CppSharp @@ -292,7 +292,7 @@ namespace CppSharp
{
UnknownArch = 0,
X86 = 1,
X8664 = 2
X86_64 = 2
}
public unsafe partial class Type : IDisposable
@ -8906,6 +8906,9 @@ namespace CppSharp @@ -8906,6 +8906,9 @@ namespace CppSharp
[FieldOffset(496)]
public byte isExternCContext;
[FieldOffset(497)]
public byte isInjected;
[FieldOffset(504)]
public global::System.IntPtr layout;
@ -9282,6 +9285,19 @@ namespace CppSharp @@ -9282,6 +9285,19 @@ namespace CppSharp
}
}
public bool IsInjected
{
get
{
return ((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected != 0;
}
set
{
((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected = (byte) (value ? 1 : 0);
}
}
public global::CppSharp.Parser.AST.ClassLayout Layout
{
get
@ -10798,6 +10814,9 @@ namespace CppSharp @@ -10798,6 +10814,9 @@ namespace CppSharp
[FieldOffset(496)]
public byte isExternCContext;
[FieldOffset(497)]
public byte isInjected;
[FieldOffset(504)]
public global::System.IntPtr layout;
@ -11099,6 +11118,9 @@ namespace CppSharp @@ -11099,6 +11118,9 @@ namespace CppSharp
[FieldOffset(496)]
public byte isExternCContext;
[FieldOffset(497)]
public byte isInjected;
[FieldOffset(504)]
public global::System.IntPtr layout;

14
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std.cs

@ -45,12 +45,12 @@ namespace Std @@ -45,12 +45,12 @@ namespace Std
public unsafe partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSaIcEC2Ev")]
internal static extern void ctorc__N_std_S_allocator__C_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSaIcED2Ev")]
internal static extern void dtorc__N_std_S_allocator__C_0(global::System.IntPtr instance);
}
@ -204,8 +204,8 @@ namespace Std @@ -204,8 +204,8 @@ namespace Std
{
public enum RbTreeColor : uint
{
SRed = 0,
SBlack = 1
S_red = 0,
S_black = 1
}
namespace RbTree
@ -333,7 +333,7 @@ namespace Std @@ -333,7 +333,7 @@ namespace Std
public unsafe partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSt11char_traitsIcE3eofEv")]
internal static extern int Eofc__N_std_S_char_traits__C_0();
}
@ -634,12 +634,12 @@ namespace Std @@ -634,12 +634,12 @@ namespace Std
internal global::Std.BasicString.AllocHider.__Internal _M_dataplus;
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNSsD2Ev")]
internal static extern void dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="_ZNKSs5c_strEv")]
internal static extern global::System.IntPtr CStrc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance);
}

28
src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/CppSharp.CppParser.cs

@ -230,8 +230,8 @@ namespace CppSharp @@ -230,8 +230,8 @@ namespace CppSharp
Itanium = 0,
Microsoft = 1,
ARM = 2,
IOS = 3,
IOS64 = 4
iOS = 3,
iOS64 = 4
}
public enum VTableComponentKind
@ -292,7 +292,7 @@ namespace CppSharp @@ -292,7 +292,7 @@ namespace CppSharp
{
UnknownArch = 0,
X86 = 1,
X8664 = 2
X86_64 = 2
}
public unsafe partial class Type : IDisposable
@ -8907,6 +8907,9 @@ namespace CppSharp @@ -8907,6 +8907,9 @@ namespace CppSharp
[FieldOffset(536)]
public byte isExternCContext;
[FieldOffset(537)]
public byte isInjected;
[FieldOffset(544)]
public global::System.IntPtr layout;
@ -9283,6 +9286,19 @@ namespace CppSharp @@ -9283,6 +9286,19 @@ namespace CppSharp
}
}
public bool IsInjected
{
get
{
return ((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected != 0;
}
set
{
((global::CppSharp.Parser.AST.Class.__Internal*) __Instance)->isInjected = (byte) (value ? 1 : 0);
}
}
public global::CppSharp.Parser.AST.ClassLayout Layout
{
get
@ -10799,6 +10815,9 @@ namespace CppSharp @@ -10799,6 +10815,9 @@ namespace CppSharp
[FieldOffset(536)]
public byte isExternCContext;
[FieldOffset(537)]
public byte isInjected;
[FieldOffset(544)]
public global::System.IntPtr layout;
@ -11100,6 +11119,9 @@ namespace CppSharp @@ -11100,6 +11119,9 @@ namespace CppSharp
[FieldOffset(536)]
public byte isExternCContext;
[FieldOffset(537)]
public byte isInjected;
[FieldOffset(544)]
public global::System.IntPtr layout;

10
src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std.cs

@ -63,7 +63,7 @@ namespace Std @@ -63,7 +63,7 @@ namespace Std
public unsafe partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="?eof@?$char_traits@D@std@@SAHXZ")]
internal static extern int Eofc__N_std_S_char_traits__C_0();
}
@ -477,7 +477,7 @@ namespace Std @@ -477,7 +477,7 @@ namespace Std
public unsafe partial struct __Internal
{
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="??0?$allocator@D@std@@QEAA@XZ")]
internal static extern global::System.IntPtr ctorc__N_std_S_allocator__C_0(global::System.IntPtr instance);
}
@ -553,7 +553,7 @@ namespace Std @@ -553,7 +553,7 @@ namespace Std
}
}
public unsafe partial class _SETJMP_FLOAT128
public unsafe partial class SETJMP_FLOAT128
{
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct __Internal
@ -578,12 +578,12 @@ namespace Std @@ -578,12 +578,12 @@ namespace Std
internal global::Std.CompressedPair.__Internalc__N_std_S__Compressed_pair____N_std_S__Wrap_alloc____N_std_S_allocator__C___N_std_S__String_val____N_std_S__Simple_types__C_Vb1 _Mypair;
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ")]
internal static extern void dtorc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance, int delete);
[SuppressUnmanagedCodeSecurity]
[DllImport("Std-templates", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
[DllImport("Std-symbols", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ")]
internal static extern global::System.IntPtr CStrc__N_std_S_basic_string__C___N_std_S_char_traits__C___N_std_S_allocator__C_0(global::System.IntPtr instance);
}

4
src/CppParser/Parser.cpp

@ -795,9 +795,6 @@ Class* Parser::GetRecord(const clang::RecordDecl* Record, bool& Process) @@ -795,9 +795,6 @@ Class* Parser::GetRecord(const clang::RecordDecl* Record, bool& Process)
using namespace clang;
Process = false;
if (Record->isInjectedClassName())
return nullptr;
auto NS = GetNamespace(Record);
assert(NS && "Expected a valid namespace");
@ -823,6 +820,7 @@ Class* Parser::GetRecord(const clang::RecordDecl* Record, bool& Process) @@ -823,6 +820,7 @@ Class* Parser::GetRecord(const clang::RecordDecl* Record, bool& Process)
return RC;
RC = NS->FindClass(Name, isCompleteDefinition, /*Create=*/true);
RC->isInjected = Record->isInjectedClassName();
HandleDeclaration(Record, RC);
EnsureCompleteRecord(Record, NS, RC);

2
src/Generator/Generators/CSharp/CSharpSources.cs

@ -144,7 +144,7 @@ namespace CppSharp.Generators.CSharp @@ -144,7 +144,7 @@ namespace CppSharp.Generators.CSharp
foreach (var typedef in context.Typedefs)
typedef.Visit(this);
foreach (var @class in context.Classes)
foreach (var @class in context.Classes.Where(c => !(c is ClassTemplateSpecialization)))
@class.Visit(this);
foreach (var @event in context.Events)

21
src/Generator/Passes/CheckIgnoredDecls.cs

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
using CppSharp.AST;
using CppSharp.AST.Extensions;
using CppSharp.Types;
using System.Collections.Generic;
namespace CppSharp.Passes
{
@ -38,7 +39,13 @@ namespace CppSharp.Passes @@ -38,7 +39,13 @@ namespace CppSharp.Passes
public override bool VisitClassDecl(Class @class)
{
if (!base.VisitClassDecl(@class) || !@class.IsDependent)
if (!base.VisitClassDecl(@class))
return false;
if (@class.IsInjected)
injectedClasses.Add(@class);
if (!@class.IsDependent)
return false;
// templates are not supported yet
@ -323,6 +330,16 @@ namespace CppSharp.Passes @@ -323,6 +330,16 @@ namespace CppSharp.Passes
return true;
}
public override bool VisitASTContext(ASTContext c)
{
base.VisitASTContext(c);
foreach (var injectedClass in injectedClasses)
injectedClass.Namespace.Declarations.Remove(injectedClass);
return true;
}
#region Helpers
/// <remarks>
@ -448,5 +465,7 @@ namespace CppSharp.Passes @@ -448,5 +465,7 @@ namespace CppSharp.Passes
}
#endregion
private HashSet<Declaration> injectedClasses = new HashSet<Declaration>();
}
}

5
src/Parser/ASTConverter.cs

@ -1509,6 +1509,7 @@ namespace CppSharp @@ -1509,6 +1509,7 @@ namespace CppSharp
_class.HasNonTrivialCopyConstructor = @class.HasNonTrivialCopyConstructor;
_class.HasNonTrivialDestructor = @class.HasNonTrivialDestructor;
_class.IsExternCContext = @class.IsExternCContext;
_class.IsInjected = @class.IsInjected;
if (@class.Layout != null)
_class.Layout = VisitClassLayout(@class.Layout);
@ -1575,9 +1576,9 @@ namespace CppSharp @@ -1575,9 +1576,9 @@ namespace CppSharp
return AST.CppAbi.Microsoft;
case CppAbi.ARM:
return AST.CppAbi.ARM;
case CppAbi.IOS:
case CppAbi.iOS:
return AST.CppAbi.iOS;
case CppAbi.IOS64:
case CppAbi.iOS64:
return AST.CppAbi.iOS64;
default:
throw new ArgumentOutOfRangeException("abi");

Loading…
Cancel
Save