|
|
@ -566,25 +566,27 @@ namespace CppSharp.Generators.CLI |
|
|
|
if (prop.Ignore) continue; |
|
|
|
if (prop.Ignore) continue; |
|
|
|
|
|
|
|
|
|
|
|
GenerateDeclarationCommon(prop); |
|
|
|
GenerateDeclarationCommon(prop); |
|
|
|
GenerateProperty(prop, prop.HasGetter, prop.HasSetter); |
|
|
|
GenerateProperty(prop); |
|
|
|
} |
|
|
|
} |
|
|
|
PopIndent(); |
|
|
|
PopIndent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void GenerateProperty<T>(T decl, bool isGetter = true, bool isSetter = true) |
|
|
|
public void GenerateProperty(Property property) |
|
|
|
where T : Declaration, ITypedDecl |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!(isGetter || isSetter)) |
|
|
|
if (!(property.HasGetter || property.HasSetter)) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
PushBlock(CLIBlockKind.Property, decl); |
|
|
|
PushBlock(CLIBlockKind.Property, property); |
|
|
|
var type = decl.Type.Visit(TypePrinter, decl.QualifiedType.Qualifiers); |
|
|
|
var type = property.QualifiedType.Visit(TypePrinter); |
|
|
|
|
|
|
|
|
|
|
|
WriteLine("property {0} {1}", type, decl.Name); |
|
|
|
WriteLine("property {0} {1}", type, property.Name); |
|
|
|
WriteStartBraceIndent(); |
|
|
|
WriteStartBraceIndent(); |
|
|
|
|
|
|
|
|
|
|
|
if(isGetter) WriteLine("{0} get();", type); |
|
|
|
if(property.HasGetter) |
|
|
|
if(isSetter) WriteLine("void set({0});", type); |
|
|
|
WriteLine("{0} get();", type); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(property.HasSetter) |
|
|
|
|
|
|
|
WriteLine("void set({0});", type); |
|
|
|
|
|
|
|
|
|
|
|
WriteCloseBraceIndent(); |
|
|
|
WriteCloseBraceIndent(); |
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|