mirror of https://github.com/mono/CppSharp.git
2 changed files with 20 additions and 13 deletions
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
using CppSharp.AST.Extensions; |
||||
|
||||
namespace CppSharp.AST |
||||
{ |
||||
public static class PropertyExtensions |
||||
{ |
||||
public static bool IsInRefTypeAndBackedByValueClassField(this Property p) |
||||
{ |
||||
if (p.Field == null || ((Class) p.Namespace).IsRefType) |
||||
return false; |
||||
|
||||
Type type; |
||||
p.Field.Type.IsPointerTo(out type); |
||||
type = type ?? p.Field.Type; |
||||
|
||||
Class decl; |
||||
return type.IsTagDecl(out decl) && decl.IsValueType; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue