|
|
@ -27,6 +27,18 @@ namespace CppSharp.Generators.CLI |
|
|
|
protected const string DefaultIndent = " "; |
|
|
|
protected const string DefaultIndent = " "; |
|
|
|
protected const uint MaxIndent = 80; |
|
|
|
protected const uint MaxIndent = 80; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public delegate void GenerateTextDelegate(CLITextTemplate gen); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Called when the generation is starting.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public GenerateTextDelegate OnStart = delegate { }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Called when generating namespaces.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public GenerateTextDelegate OnNamespaces = delegate { }; |
|
|
|
|
|
|
|
|
|
|
|
public CLITypePrinter TypePrinter { get; set; } |
|
|
|
public CLITypePrinter TypePrinter { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
public ISet<Include> Includes; |
|
|
|
public ISet<Include> Includes; |
|
|
@ -50,30 +62,6 @@ namespace CppSharp.Generators.CLI |
|
|
|
return string.Format("{0}", decl.QualifiedName); |
|
|
|
return string.Format("{0}", decl.QualifiedName); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void GenerateStart() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (Transform == null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
WriteLine("//----------------------------------------------------------------------------"); |
|
|
|
|
|
|
|
WriteLine("// This is autogenerated code by cxxi-generator."); |
|
|
|
|
|
|
|
WriteLine("// Do not edit this file or all your changes will be lost after re-generation."); |
|
|
|
|
|
|
|
WriteLine("//----------------------------------------------------------------------------"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (FileExtension == "cpp") |
|
|
|
|
|
|
|
WriteLine(@"#include ""../interop.h"" // marshalString"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Transform.GenerateStart(this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void GenerateAfterNamespaces() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (Transform != null) |
|
|
|
|
|
|
|
Transform.GenerateAfterNamespaces(this); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void GenerateSummary(string comment) |
|
|
|
public void GenerateSummary(string comment) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (string.IsNullOrWhiteSpace(comment)) |
|
|
|
if (string.IsNullOrWhiteSpace(comment)) |
|
|
|