From 9a2a0a5a5c2cb54ac89630b370376608a70c0baa Mon Sep 17 00:00:00 2001 From: triton Date: Wed, 8 May 2013 23:14:36 +0100 Subject: [PATCH] Added better support for properties. --- src/Bridge/Declaration.cs | 1 + src/Bridge/Property.cs | 9 ++++----- .../Generators/CLI/CLIForwardReferencePrinter.cs | 5 +++++ src/Generator/Generators/CLI/CLITypePrinter.cs | 5 +++++ src/Generator/Generators/CSharp/CSharpTypePrinter.cs | 5 +++++ src/Generator/Types/CppTypePrinter.cs | 5 +++++ 6 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/Bridge/Declaration.cs b/src/Bridge/Declaration.cs index ad71db57..91162123 100644 --- a/src/Bridge/Declaration.cs +++ b/src/Bridge/Declaration.cs @@ -207,5 +207,6 @@ namespace CppSharp T VisitMacroDefinition(MacroDefinition macro); T VisitNamespace(Namespace @namespace); T VisitEvent(Event @event); + T VisitProperty(Property @property); } } \ No newline at end of file diff --git a/src/Bridge/Property.cs b/src/Bridge/Property.cs index 177d44cd..0ae3935c 100644 --- a/src/Bridge/Property.cs +++ b/src/Bridge/Property.cs @@ -8,13 +8,12 @@ namespace CppSharp /// public class Property : Declaration { - public Property(string name, Declaration type) + public Property() { - Name = name; - Type = type; + } - public Declaration Type + public Type Type { get; set; @@ -34,7 +33,7 @@ namespace CppSharp public override T Visit(IDeclVisitor visitor) { - throw new NotImplementedException(); + return visitor.VisitProperty(this); } } } \ No newline at end of file diff --git a/src/Generator/Generators/CLI/CLIForwardReferencePrinter.cs b/src/Generator/Generators/CLI/CLIForwardReferencePrinter.cs index d14661fa..64c037de 100644 --- a/src/Generator/Generators/CLI/CLIForwardReferencePrinter.cs +++ b/src/Generator/Generators/CLI/CLIForwardReferencePrinter.cs @@ -197,5 +197,10 @@ namespace CppSharp.Generators.CLI { throw new NotImplementedException(); } + + public bool VisitProperty(Property property) + { + throw new NotImplementedException(); + } } } \ No newline at end of file diff --git a/src/Generator/Generators/CLI/CLITypePrinter.cs b/src/Generator/Generators/CLI/CLITypePrinter.cs index d1d8d0a1..19543e38 100644 --- a/src/Generator/Generators/CLI/CLITypePrinter.cs +++ b/src/Generator/Generators/CLI/CLITypePrinter.cs @@ -324,6 +324,11 @@ namespace CppSharp.Generators.CLI throw new NotImplementedException(); } + public string VisitProperty(Property property) + { + throw new NotImplementedException(); + } + public string ToString(Type type) { return type.Visit(this); diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index 1ffc7772..0996a41b 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -365,6 +365,11 @@ namespace CppSharp.Generators.CSharp throw new NotImplementedException(); } + public CSharpTypePrinterResult VisitProperty(Property property) + { + throw new NotImplementedException(); + } + public CSharpTypePrinterResult VisitParameters(IEnumerable @params, bool hasNames) { diff --git a/src/Generator/Types/CppTypePrinter.cs b/src/Generator/Types/CppTypePrinter.cs index ec13df69..f599cc9f 100644 --- a/src/Generator/Types/CppTypePrinter.cs +++ b/src/Generator/Types/CppTypePrinter.cs @@ -242,6 +242,11 @@ namespace CppSharp.Types throw new NotImplementedException(); } + public string VisitProperty(Property property) + { + throw new NotImplementedException(); + } + public string ToString(Type type) { return type.Visit(this);