Tools and libraries to glue C/C++ APIs to high-level languages
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

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;
}
}
}