|
|
@ -1,4 +1,3 @@ |
|
|
|
using System; |
|
|
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.Generic; |
|
|
|
using CppSharp.AST; |
|
|
|
using CppSharp.AST; |
|
|
|
using CppSharp.Generators.C; |
|
|
|
using CppSharp.Generators.C; |
|
|
@ -12,14 +11,8 @@ namespace CppSharp.Generators.CLI |
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public abstract class CLITemplate : CCodeGenerator |
|
|
|
public abstract class CLITemplate : CCodeGenerator |
|
|
|
{ |
|
|
|
{ |
|
|
|
public ISet<CInclude> Includes; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected CLITemplate(BindingContext context, IEnumerable<TranslationUnit> units) |
|
|
|
protected CLITemplate(BindingContext context, IEnumerable<TranslationUnit> units) |
|
|
|
: base(context, units) |
|
|
|
: base(context, units) => typePrinter = new CLITypePrinter(context); |
|
|
|
{ |
|
|
|
|
|
|
|
typePrinter = new CLITypePrinter(context); |
|
|
|
|
|
|
|
Includes = new HashSet<CInclude>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public abstract override string FileExtension { get; } |
|
|
|
public abstract override string FileExtension { get; } |
|
|
|
|
|
|
|
|
|
|
@ -27,19 +20,6 @@ namespace CppSharp.Generators.CLI |
|
|
|
|
|
|
|
|
|
|
|
#region Helpers
|
|
|
|
#region Helpers
|
|
|
|
|
|
|
|
|
|
|
|
public string QualifiedIdentifier(Declaration decl) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(TranslationUnit.Module.OutputNamespace)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(decl.QualifiedName)) |
|
|
|
|
|
|
|
return $"{decl.TranslationUnit.Module.OutputNamespace}"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $"{decl.TranslationUnit.Module.OutputNamespace}::{decl.QualifiedName}"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return decl.QualifiedName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public string GetMethodName(Method method) |
|
|
|
public string GetMethodName(Method method) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (method.OperatorKind == CXXOperatorKind.Conversion || |
|
|
|
if (method.OperatorKind == CXXOperatorKind.Conversion || |
|
|
|