diff --git a/src/AST/Declaration.cs b/src/AST/Declaration.cs index 97d62221..edb3864c 100644 --- a/src/AST/Declaration.cs +++ b/src/AST/Declaration.cs @@ -94,9 +94,6 @@ namespace CppSharp.AST // Comment associated with declaration. public RawComment Comment; - // Doxygen-style brief comment. - public string BriefComment; - // Keeps flags to know the type of ignore. public IgnoreFlags IgnoreFlags { get; set; } diff --git a/src/Generator/Generators/CLI/CLIHeadersTemplate.cs b/src/Generator/Generators/CLI/CLIHeadersTemplate.cs index 4d21dac1..65501373 100644 --- a/src/Generator/Generators/CLI/CLIHeadersTemplate.cs +++ b/src/Generator/Generators/CLI/CLIHeadersTemplate.cs @@ -177,12 +177,6 @@ namespace CppSharp.Generators.CLI PopBlock(NewLineKind.BeforeNextBlock); } - public void GenerateDeclarationCommon(Declaration T) - { - GenerateSummary(T.BriefComment); - GenerateDebug(T); - } - public void GenerateClass(Class @class) { if (@class.Ignore || @class.IsIncomplete) @@ -589,12 +583,6 @@ namespace CppSharp.Generators.CLI PopBlock(); } - public void GenerateDebug(Declaration decl) - { - if (Options.OutputDebug && !String.IsNullOrWhiteSpace(decl.DebugText)) - WriteLine("// DEBUG: " + decl.DebugText); - } - public void GenerateEnum(Enumeration @enum) { if (@enum.Ignore || @enum.IsIncomplete) diff --git a/src/Generator/Generators/CLI/CLISourcesTemplate.cs b/src/Generator/Generators/CLI/CLISourcesTemplate.cs index c8fa8214..36155b54 100644 --- a/src/Generator/Generators/CLI/CLISourcesTemplate.cs +++ b/src/Generator/Generators/CLI/CLISourcesTemplate.cs @@ -108,12 +108,6 @@ namespace CppSharp.Generators.CLI PopBlock(); } - public void GenerateDeclarationCommon(Declaration decl) - { - if (!string.IsNullOrWhiteSpace(decl.BriefComment)) - WriteLine("// {0}", decl.BriefComment); - } - public void GenerateClass(Class @class) { PushBlock(CLIBlockKind.Class); @@ -897,12 +891,6 @@ namespace CppSharp.Generators.CLI Write(string.Join(", ", names)); } - public void GenerateDebug(Declaration decl) - { - if (Options.OutputDebug && !String.IsNullOrWhiteSpace(decl.DebugText)) - WriteLine("// DEBUG: " + decl.DebugText); - } - public override string FileExtension { get { return "cpp"; } } } } diff --git a/src/Generator/Generators/CLI/CLITextTemplate.cs b/src/Generator/Generators/CLI/CLITextTemplate.cs index 965d231b..7b667bdb 100644 --- a/src/Generator/Generators/CLI/CLITextTemplate.cs +++ b/src/Generator/Generators/CLI/CLITextTemplate.cs @@ -76,6 +76,15 @@ namespace CppSharp.Generators.CLI return string.Format("{0}", decl.QualifiedName); } + public void GenerateDeclarationCommon(Declaration decl) + { + if (decl.Comment == null) + return; + + GenerateSummary(decl.Comment.BriefText); + GenerateDebug(decl); + } + public void GenerateSummary(string comment) { if (string.IsNullOrWhiteSpace(comment)) @@ -98,6 +107,12 @@ namespace CppSharp.Generators.CLI PopBlock(); } + public void GenerateDebug(Declaration decl) + { + if (Options.OutputDebug && !String.IsNullOrWhiteSpace(decl.DebugText)) + WriteLine("// DEBUG: " + decl.DebugText); + } + public void GenerateMethodParameters(Method method) { for (var i = 0; i < method.Parameters.Count; ++i) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 28893af3..36c4a5f5 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -262,7 +262,10 @@ namespace CppSharp.Generators.CSharp public void GenerateDeclarationCommon(Declaration decl) { - GenerateSummary(decl.BriefComment); + if (decl.Comment == null) + return; + + GenerateSummary(decl.Comment.BriefText); GenerateDebug(decl); }