mirror of https://github.com/mono/CppSharp.git
c-sharpdotnetmonobindingsbridgecclangcpluspluscppsharpglueinteropparserparsingpinvokeswigsyntax-treevisitorsxamarinxamarin-bindings
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
806 B
33 lines
806 B
using CppSharp.AST; |
|
|
|
namespace CppSharp.Passes |
|
{ |
|
public class FieldToPropertyPass : TranslationUnitPass |
|
{ |
|
public override bool VisitFieldDecl(Field field) |
|
{ |
|
var @class = field.Namespace as Class; |
|
if (@class == null) |
|
return false; |
|
|
|
if (@class.IsValueType) |
|
return false; |
|
|
|
if (ASTUtils.CheckIgnoreField(field)) |
|
return false; |
|
|
|
var prop = new Property() |
|
{ |
|
Name = field.Name, |
|
Namespace = field.Namespace, |
|
QualifiedType = field.QualifiedType, |
|
Field = field |
|
}; |
|
@class.Properties.Add(prop); |
|
|
|
field.ExplicityIgnored = true; |
|
|
|
return false; |
|
} |
|
} |
|
}
|
|
|