Browse Source

Regenerated the parser bindings with all fixes for v-tables and dtors.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/553/head
Dimitar Dobrev 10 years ago
parent
commit
beabb8224d
  1. 4
      src/Core/Parser/ASTConverter.cs
  2. 16
      src/CppParser/AST.cpp
  3. 3
      src/CppParser/AST.h
  4. 2296
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs
  5. 119
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs
  6. 25
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs
  7. 2296
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs
  8. 119
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs
  9. 25
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs
  10. 2296
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs
  11. 119
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs
  12. 25
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs
  13. 2296
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs
  14. 119
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs
  15. 25
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs

4
src/Core/Parser/ASTConverter.cs

@ -957,8 +957,6 @@ namespace CppSharp
expression.Declaration = typeConverter.declConverter.Visit(statement.Decl); expression.Declaration = typeConverter.declConverter.Visit(statement.Decl);
expression.String = statement.String; expression.String = statement.String;
NativeObjects.Add(statement);
return expression; return expression;
} }
@ -1314,8 +1312,6 @@ namespace CppSharp
_layout.VFTables.Add(_vftableInfo); _layout.VFTables.Add(_vftableInfo);
} }
NativeObjects.Add(layout);
return _layout; return _layout;
} }

16
src/CppParser/AST.cpp

@ -178,6 +178,10 @@ Declaration::Declaration(const Declaration& rhs)
{ {
} }
Declaration::~Declaration()
{
}
DEF_STRING(Declaration, Name) DEF_STRING(Declaration, Name)
DEF_STRING(Declaration, DebugText) DEF_STRING(Declaration, DebugText)
DEF_VECTOR(Declaration, PreprocessedEntity*, PreprocessedEntities) DEF_VECTOR(Declaration, PreprocessedEntity*, PreprocessedEntities)
@ -492,6 +496,12 @@ DEF_VECTOR(CXXConstructExpr, Expression*, Arguments)
Parameter::Parameter() : Declaration(DeclarationKind::Parameter), Parameter::Parameter() : Declaration(DeclarationKind::Parameter),
IsIndirect(false), HasDefaultValue(false), DefaultArgument(0) {} IsIndirect(false), HasDefaultValue(false), DefaultArgument(0) {}
Parameter::~Parameter()
{
if (DefaultArgument)
delete DefaultArgument;
}
Function::Function() Function::Function()
: Declaration(DeclarationKind::Function) : Declaration(DeclarationKind::Function)
, IsReturnIndirect(false) , IsReturnIndirect(false)
@ -569,6 +579,12 @@ Class::Class()
{ {
} }
Class::~Class()
{
if (Layout)
delete Layout;
}
DEF_VECTOR(Class, BaseClassSpecifier*, Bases) DEF_VECTOR(Class, BaseClassSpecifier*, Bases)
DEF_VECTOR(Class, Field*, Fields) DEF_VECTOR(Class, Field*, Fields)
DEF_VECTOR(Class, Method*, Methods) DEF_VECTOR(Class, Method*, Methods)

3
src/CppParser/AST.h

@ -387,6 +387,7 @@ class CS_API Declaration
public: public:
Declaration(DeclarationKind kind); Declaration(DeclarationKind kind);
Declaration(const Declaration&); Declaration(const Declaration&);
~Declaration();
DeclarationKind Kind; DeclarationKind Kind;
AccessSpecifier Access; AccessSpecifier Access;
@ -522,6 +523,7 @@ class CS_API Parameter : public Declaration
{ {
public: public:
Parameter(); Parameter();
~Parameter();
CppSharp::CppParser::AST::QualifiedType QualifiedType; CppSharp::CppParser::AST::QualifiedType QualifiedType;
bool IsIndirect; bool IsIndirect;
@ -709,6 +711,7 @@ class CS_API Class : public DeclarationContext
{ {
public: public:
Class(); Class();
~Class();
VECTOR(BaseClassSpecifier*, Bases) VECTOR(BaseClassSpecifier*, Bases)
VECTOR(Field*, Fields) VECTOR(Field*, Fields)

2296
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs

File diff suppressed because it is too large Load Diff

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

@ -60,16 +60,16 @@ namespace CppSharp
public CppSharp.Parser.AST.CppAbi Abi; public CppSharp.Parser.AST.CppAbi Abi;
[FieldOffset(108)] [FieldOffset(108)]
public bool NoStandardIncludes; public byte NoStandardIncludes;
[FieldOffset(109)] [FieldOffset(109)]
public bool NoBuiltinIncludes; public byte NoBuiltinIncludes;
[FieldOffset(110)] [FieldOffset(110)]
public bool MicrosoftMode; public byte MicrosoftMode;
[FieldOffset(111)] [FieldOffset(111)]
public bool Verbose; public byte Verbose;
[FieldOffset(112)] [FieldOffset(112)]
public CppSharp.Parser.LanguageVersion LanguageVersion; public CppSharp.Parser.LanguageVersion LanguageVersion;
@ -232,8 +232,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -268,17 +269,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(116); __Instance = Marshal.AllocHGlobal(116);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserOptions(CppSharp.Parser.ParserOptions _0) public ParserOptions(CppSharp.Parser.ParserOptions _0)
{ {
__Instance = Marshal.AllocHGlobal(116); __Instance = Marshal.AllocHGlobal(116);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0); Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -288,22 +289,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserOptions __dummy; CppSharp.Parser.ParserOptions __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string getArguments(uint i) public string getArguments(uint i)
@ -548,12 +539,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->NoStandardIncludes; return ((Internal*) __Instance)->NoStandardIncludes != 0;
} }
set set
{ {
((Internal*) __Instance)->NoStandardIncludes = value; ((Internal*) __Instance)->NoStandardIncludes = (byte) (value ? 1 : 0);
} }
} }
@ -561,12 +552,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->NoBuiltinIncludes; return ((Internal*) __Instance)->NoBuiltinIncludes != 0;
} }
set set
{ {
((Internal*) __Instance)->NoBuiltinIncludes = value; ((Internal*) __Instance)->NoBuiltinIncludes = (byte) (value ? 1 : 0);
} }
} }
@ -574,12 +565,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->MicrosoftMode; return ((Internal*) __Instance)->MicrosoftMode != 0;
} }
set set
{ {
((Internal*) __Instance)->MicrosoftMode = value; ((Internal*) __Instance)->MicrosoftMode = (byte) (value ? 1 : 0);
} }
} }
@ -587,12 +578,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->Verbose; return ((Internal*) __Instance)->Verbose != 0;
} }
set set
{ {
((Internal*) __Instance)->Verbose = value; ((Internal*) __Instance)->Verbose = (byte) (value ? 1 : 0);
} }
} }
@ -662,8 +653,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -698,17 +690,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(36); __Instance = Marshal.AllocHGlobal(36);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0) public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0)
{ {
__Instance = Marshal.AllocHGlobal(36); __Instance = Marshal.AllocHGlobal(36);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0); Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -718,22 +710,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserDiagnostic __dummy; CppSharp.Parser.ParserDiagnostic __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string FileName public string FileName
@ -863,8 +845,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -899,17 +882,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(28); __Instance = Marshal.AllocHGlobal(28);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserResult(CppSharp.Parser.ParserResult _0) public ParserResult(CppSharp.Parser.ParserResult _0)
{ {
__Instance = Marshal.AllocHGlobal(28); __Instance = Marshal.AllocHGlobal(28);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0); Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -919,22 +902,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserResult __dummy; CppSharp.Parser.ParserResult __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i) public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i)
@ -1042,8 +1015,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -1085,8 +1059,8 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(0); __Instance = Marshal.AllocHGlobal(0);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
*((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance); *((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -1096,20 +1070,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ClangParser __dummy; CppSharp.Parser.ClangParser __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance) Marshal.FreeHGlobal(__Instance);
Marshal.FreeHGlobal(__Instance);
} }
public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts) public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts)

25
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs

@ -172,8 +172,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -208,17 +209,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(164); __Instance = Marshal.AllocHGlobal(164);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_1(__Instance); Internal.ctor_1(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0) public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0)
{ {
__Instance = Marshal.AllocHGlobal(164); __Instance = Marshal.AllocHGlobal(164);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0); Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -228,22 +229,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserTargetInfo __dummy; CppSharp.Parser.ParserTargetInfo __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string ABI public string ABI

2296
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs

File diff suppressed because it is too large Load Diff

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

@ -60,16 +60,16 @@ namespace CppSharp
public CppSharp.Parser.AST.CppAbi Abi; public CppSharp.Parser.AST.CppAbi Abi;
[FieldOffset(132)] [FieldOffset(132)]
public bool NoStandardIncludes; public byte NoStandardIncludes;
[FieldOffset(133)] [FieldOffset(133)]
public bool NoBuiltinIncludes; public byte NoBuiltinIncludes;
[FieldOffset(134)] [FieldOffset(134)]
public bool MicrosoftMode; public byte MicrosoftMode;
[FieldOffset(135)] [FieldOffset(135)]
public bool Verbose; public byte Verbose;
[FieldOffset(136)] [FieldOffset(136)]
public CppSharp.Parser.LanguageVersion LanguageVersion; public CppSharp.Parser.LanguageVersion LanguageVersion;
@ -232,8 +232,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -268,17 +269,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(140); __Instance = Marshal.AllocHGlobal(140);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserOptions(CppSharp.Parser.ParserOptions _0) public ParserOptions(CppSharp.Parser.ParserOptions _0)
{ {
__Instance = Marshal.AllocHGlobal(140); __Instance = Marshal.AllocHGlobal(140);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0); Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -288,22 +289,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserOptions __dummy; CppSharp.Parser.ParserOptions __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance, 0);
Internal.dtor_0(__Instance, 0); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string getArguments(uint i) public string getArguments(uint i)
@ -548,12 +539,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->NoStandardIncludes; return ((Internal*) __Instance)->NoStandardIncludes != 0;
} }
set set
{ {
((Internal*) __Instance)->NoStandardIncludes = value; ((Internal*) __Instance)->NoStandardIncludes = (byte) (value ? 1 : 0);
} }
} }
@ -561,12 +552,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->NoBuiltinIncludes; return ((Internal*) __Instance)->NoBuiltinIncludes != 0;
} }
set set
{ {
((Internal*) __Instance)->NoBuiltinIncludes = value; ((Internal*) __Instance)->NoBuiltinIncludes = (byte) (value ? 1 : 0);
} }
} }
@ -574,12 +565,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->MicrosoftMode; return ((Internal*) __Instance)->MicrosoftMode != 0;
} }
set set
{ {
((Internal*) __Instance)->MicrosoftMode = value; ((Internal*) __Instance)->MicrosoftMode = (byte) (value ? 1 : 0);
} }
} }
@ -587,12 +578,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->Verbose; return ((Internal*) __Instance)->Verbose != 0;
} }
set set
{ {
((Internal*) __Instance)->Verbose = value; ((Internal*) __Instance)->Verbose = (byte) (value ? 1 : 0);
} }
} }
@ -662,8 +653,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -698,17 +690,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(60); __Instance = Marshal.AllocHGlobal(60);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0) public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0)
{ {
__Instance = Marshal.AllocHGlobal(60); __Instance = Marshal.AllocHGlobal(60);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0); Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -718,22 +710,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserDiagnostic __dummy; CppSharp.Parser.ParserDiagnostic __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance, 0);
Internal.dtor_0(__Instance, 0); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string FileName public string FileName
@ -863,8 +845,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -899,17 +882,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(28); __Instance = Marshal.AllocHGlobal(28);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserResult(CppSharp.Parser.ParserResult _0) public ParserResult(CppSharp.Parser.ParserResult _0)
{ {
__Instance = Marshal.AllocHGlobal(28); __Instance = Marshal.AllocHGlobal(28);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0); Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -919,22 +902,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserResult __dummy; CppSharp.Parser.ParserResult __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance, 0);
Internal.dtor_0(__Instance, 0); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i) public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i)
@ -1042,8 +1015,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -1085,8 +1059,8 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(0); __Instance = Marshal.AllocHGlobal(0);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
*((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance); *((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -1096,20 +1070,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ClangParser __dummy; CppSharp.Parser.ClangParser __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance) Marshal.FreeHGlobal(__Instance);
Marshal.FreeHGlobal(__Instance);
} }
public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts) public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts)

25
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs

@ -172,8 +172,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -208,17 +209,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(176); __Instance = Marshal.AllocHGlobal(176);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_1(__Instance); Internal.ctor_1(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0) public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0)
{ {
__Instance = Marshal.AllocHGlobal(176); __Instance = Marshal.AllocHGlobal(176);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0); Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -228,22 +229,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserTargetInfo __dummy; CppSharp.Parser.ParserTargetInfo __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance, 0);
Internal.dtor_0(__Instance, 0); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string ABI public string ABI

2296
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs

File diff suppressed because it is too large Load Diff

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

@ -60,16 +60,16 @@ namespace CppSharp
public CppSharp.Parser.AST.CppAbi Abi; public CppSharp.Parser.AST.CppAbi Abi;
[FieldOffset(212)] [FieldOffset(212)]
public bool NoStandardIncludes; public byte NoStandardIncludes;
[FieldOffset(213)] [FieldOffset(213)]
public bool NoBuiltinIncludes; public byte NoBuiltinIncludes;
[FieldOffset(214)] [FieldOffset(214)]
public bool MicrosoftMode; public byte MicrosoftMode;
[FieldOffset(215)] [FieldOffset(215)]
public bool Verbose; public byte Verbose;
[FieldOffset(216)] [FieldOffset(216)]
public CppSharp.Parser.LanguageVersion LanguageVersion; public CppSharp.Parser.LanguageVersion LanguageVersion;
@ -232,8 +232,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -268,17 +269,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(224); __Instance = Marshal.AllocHGlobal(224);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserOptions(CppSharp.Parser.ParserOptions _0) public ParserOptions(CppSharp.Parser.ParserOptions _0)
{ {
__Instance = Marshal.AllocHGlobal(224); __Instance = Marshal.AllocHGlobal(224);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0); Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -288,22 +289,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserOptions __dummy; CppSharp.Parser.ParserOptions __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string getArguments(uint i) public string getArguments(uint i)
@ -548,12 +539,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->NoStandardIncludes; return ((Internal*) __Instance)->NoStandardIncludes != 0;
} }
set set
{ {
((Internal*) __Instance)->NoStandardIncludes = value; ((Internal*) __Instance)->NoStandardIncludes = (byte) (value ? 1 : 0);
} }
} }
@ -561,12 +552,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->NoBuiltinIncludes; return ((Internal*) __Instance)->NoBuiltinIncludes != 0;
} }
set set
{ {
((Internal*) __Instance)->NoBuiltinIncludes = value; ((Internal*) __Instance)->NoBuiltinIncludes = (byte) (value ? 1 : 0);
} }
} }
@ -574,12 +565,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->MicrosoftMode; return ((Internal*) __Instance)->MicrosoftMode != 0;
} }
set set
{ {
((Internal*) __Instance)->MicrosoftMode = value; ((Internal*) __Instance)->MicrosoftMode = (byte) (value ? 1 : 0);
} }
} }
@ -587,12 +578,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->Verbose; return ((Internal*) __Instance)->Verbose != 0;
} }
set set
{ {
((Internal*) __Instance)->Verbose = value; ((Internal*) __Instance)->Verbose = (byte) (value ? 1 : 0);
} }
} }
@ -662,8 +653,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -698,17 +690,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(64); __Instance = Marshal.AllocHGlobal(64);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0) public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0)
{ {
__Instance = Marshal.AllocHGlobal(64); __Instance = Marshal.AllocHGlobal(64);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0); Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -718,22 +710,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserDiagnostic __dummy; CppSharp.Parser.ParserDiagnostic __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string FileName public string FileName
@ -863,8 +845,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -899,17 +882,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(56); __Instance = Marshal.AllocHGlobal(56);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserResult(CppSharp.Parser.ParserResult _0) public ParserResult(CppSharp.Parser.ParserResult _0)
{ {
__Instance = Marshal.AllocHGlobal(56); __Instance = Marshal.AllocHGlobal(56);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0); Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -919,22 +902,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserResult __dummy; CppSharp.Parser.ParserResult __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i) public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i)
@ -1042,8 +1015,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -1085,8 +1059,8 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(0); __Instance = Marshal.AllocHGlobal(0);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
*((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance); *((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -1096,20 +1070,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ClangParser __dummy; CppSharp.Parser.ClangParser __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance) Marshal.FreeHGlobal(__Instance);
Marshal.FreeHGlobal(__Instance);
} }
public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts) public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts)

25
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs

@ -172,8 +172,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -208,17 +209,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(176); __Instance = Marshal.AllocHGlobal(176);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_1(__Instance); Internal.ctor_1(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0) public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0)
{ {
__Instance = Marshal.AllocHGlobal(176); __Instance = Marshal.AllocHGlobal(176);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0); Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -228,22 +229,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserTargetInfo __dummy; CppSharp.Parser.ParserTargetInfo __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string ABI public string ABI

2296
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs

File diff suppressed because it is too large Load Diff

119
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs

@ -60,16 +60,16 @@ namespace CppSharp
public CppSharp.Parser.AST.CppAbi Abi; public CppSharp.Parser.AST.CppAbi Abi;
[FieldOffset(180)] [FieldOffset(180)]
public bool NoStandardIncludes; public byte NoStandardIncludes;
[FieldOffset(181)] [FieldOffset(181)]
public bool NoBuiltinIncludes; public byte NoBuiltinIncludes;
[FieldOffset(182)] [FieldOffset(182)]
public bool MicrosoftMode; public byte MicrosoftMode;
[FieldOffset(183)] [FieldOffset(183)]
public bool Verbose; public byte Verbose;
[FieldOffset(184)] [FieldOffset(184)]
public CppSharp.Parser.LanguageVersion LanguageVersion; public CppSharp.Parser.LanguageVersion LanguageVersion;
@ -232,8 +232,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -268,17 +269,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(192); __Instance = Marshal.AllocHGlobal(192);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserOptions(CppSharp.Parser.ParserOptions _0) public ParserOptions(CppSharp.Parser.ParserOptions _0)
{ {
__Instance = Marshal.AllocHGlobal(192); __Instance = Marshal.AllocHGlobal(192);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0); Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -288,22 +289,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserOptions __dummy; CppSharp.Parser.ParserOptions __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string getArguments(uint i) public string getArguments(uint i)
@ -548,12 +539,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->NoStandardIncludes; return ((Internal*) __Instance)->NoStandardIncludes != 0;
} }
set set
{ {
((Internal*) __Instance)->NoStandardIncludes = value; ((Internal*) __Instance)->NoStandardIncludes = (byte) (value ? 1 : 0);
} }
} }
@ -561,12 +552,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->NoBuiltinIncludes; return ((Internal*) __Instance)->NoBuiltinIncludes != 0;
} }
set set
{ {
((Internal*) __Instance)->NoBuiltinIncludes = value; ((Internal*) __Instance)->NoBuiltinIncludes = (byte) (value ? 1 : 0);
} }
} }
@ -574,12 +565,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->MicrosoftMode; return ((Internal*) __Instance)->MicrosoftMode != 0;
} }
set set
{ {
((Internal*) __Instance)->MicrosoftMode = value; ((Internal*) __Instance)->MicrosoftMode = (byte) (value ? 1 : 0);
} }
} }
@ -587,12 +578,12 @@ namespace CppSharp
{ {
get get
{ {
return ((Internal*) __Instance)->Verbose; return ((Internal*) __Instance)->Verbose != 0;
} }
set set
{ {
((Internal*) __Instance)->Verbose = value; ((Internal*) __Instance)->Verbose = (byte) (value ? 1 : 0);
} }
} }
@ -662,8 +653,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -698,17 +690,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(32); __Instance = Marshal.AllocHGlobal(32);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0) public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0)
{ {
__Instance = Marshal.AllocHGlobal(32); __Instance = Marshal.AllocHGlobal(32);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0); Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -718,22 +710,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserDiagnostic __dummy; CppSharp.Parser.ParserDiagnostic __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string FileName public string FileName
@ -863,8 +845,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -899,17 +882,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(56); __Instance = Marshal.AllocHGlobal(56);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance); Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public ParserResult(CppSharp.Parser.ParserResult _0) public ParserResult(CppSharp.Parser.ParserResult _0)
{ {
__Instance = Marshal.AllocHGlobal(56); __Instance = Marshal.AllocHGlobal(56);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0); Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -919,22 +902,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserResult __dummy; CppSharp.Parser.ParserResult __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i) public CppSharp.Parser.ParserDiagnostic getDiagnostics(uint i)
@ -1042,8 +1015,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -1085,8 +1059,8 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(0); __Instance = Marshal.AllocHGlobal(0);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
*((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance); *((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -1096,20 +1070,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ClangParser __dummy; CppSharp.Parser.ClangParser __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance) Marshal.FreeHGlobal(__Instance);
Marshal.FreeHGlobal(__Instance);
} }
public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts) public static CppSharp.Parser.ParserResult ParseHeader(CppSharp.Parser.ParserOptions Opts)

25
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs

@ -172,8 +172,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance; protected bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false) public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
@ -208,17 +209,17 @@ namespace CppSharp
{ {
__Instance = Marshal.AllocHGlobal(160); __Instance = Marshal.AllocHGlobal(160);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance; var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_0(__Instance, arg0); Internal.cctor_0(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
} }
public ParserTargetInfo() public ParserTargetInfo()
{ {
__Instance = Marshal.AllocHGlobal(160); __Instance = Marshal.AllocHGlobal(160);
__ownsNativeInstance = true; __ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_2(__Instance); Internal.ctor_2(__Instance);
NativeToManagedMap[__Instance] = this;
} }
public void Dispose() public void Dispose()
@ -228,22 +229,12 @@ namespace CppSharp
protected virtual void Dispose(bool disposing) protected virtual void Dispose(bool disposing)
{ {
DestroyNativeInstance(false); if (!__ownsNativeInstance && disposing)
} throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
CppSharp.Parser.ParserTargetInfo __dummy; CppSharp.Parser.ParserTargetInfo __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy); NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force) Internal.dtor_0(__Instance);
Internal.dtor_0(__Instance); Marshal.FreeHGlobal(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
} }
public string ABI public string ABI

Loading…
Cancel
Save