Browse Source

Rename CodeGenerator.Templates to Outputs.

pull/729/merge
Joao Matos 8 years ago
parent
commit
04ee2e5b7d
  1. 4
      src/CppParser/ParserGen/ParserGen.cs
  2. 2
      src/Generator/Driver.cs
  3. 8
      src/Generator/Generator.cs
  4. 2
      src/Generator/Passes/InlinesCodeGenerator.cs
  5. 4
      src/Generator/Passes/ObjectOverridesPass.cs
  6. 2
      tests/NamespacesDerived/NamespacesDerived.cs

4
src/CppParser/ParserGen/ParserGen.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -168,7 +168,7 @@ namespace CppSharp @@ -168,7 +168,7 @@ namespace CppSharp
{
driver.Generator.OnUnitGenerated += o =>
{
Block firstBlock = o.Templates[0].RootBlock.Blocks[1];
Block firstBlock = o.Outputs[0].RootBlock.Blocks[1];
if (o.TranslationUnit.Module == driver.Options.SystemModule)
{
firstBlock.NewLine();

2
src/Generator/Driver.cs

@ -373,7 +373,7 @@ namespace CppSharp @@ -373,7 +373,7 @@ namespace CppSharp
if (Options.GenerateName != null)
fileBase = Options.GenerateName(output.TranslationUnit);
foreach (var template in output.Templates)
foreach (var template in output.Outputs)
{
var fileRelativePath = string.Format("{0}.{1}", fileBase, template.FileExtension);

8
src/Generator/Generator.cs

@ -31,7 +31,7 @@ namespace CppSharp.Generators @@ -31,7 +31,7 @@ namespace CppSharp.Generators
/// <summary>
/// Code generators with generated output.
/// </summary>
public List<CodeGenerator> Templates;
public List<CodeGenerator> Outputs;
}
/// <summary>
@ -101,7 +101,7 @@ namespace CppSharp.Generators @@ -101,7 +101,7 @@ namespace CppSharp.Generators
var output = new GeneratorOutput
{
TranslationUnit = unit,
Templates = templates
Outputs = templates
};
outputs.Add(output);
@ -122,9 +122,9 @@ namespace CppSharp.Generators @@ -122,9 +122,9 @@ namespace CppSharp.Generators
FilePath = string.Format("{0}.cs", module.LibraryName),
Module = module
},
Templates = Generate(module.Units.GetGenerated())
Outputs = Generate(module.Units.GetGenerated())
};
output.Templates[0].Process();
output.Outputs[0].Process();
outputs.Add(output);
OnUnitGenerated(output);

2
src/Generator/Passes/InlinesCodeGenerator.cs

@ -7,7 +7,7 @@ using CppSharp.Generators; @@ -7,7 +7,7 @@ using CppSharp.Generators;
namespace CppSharp.Passes
{
public class InlinesCodeGenerator : CodeTemplate
public class InlinesCodeGenerator : CodeGenerator
{
public override string FileExtension => "cpp";

4
src/Generator/Passes/ObjectOverridesPass.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using CppSharp.AST;
@ -26,7 +26,7 @@ namespace CppSharp @@ -26,7 +26,7 @@ namespace CppSharp
private void OnUnitGenerated(GeneratorOutput output)
{
needsStreamInclude = false;
foreach (var template in output.Templates)
foreach (var template in output.Outputs)
{
foreach (var block in template.FindBlocks(CLIBlockKind.MethodBody))
{

2
tests/NamespacesDerived/NamespacesDerived.cs

@ -36,7 +36,7 @@ namespace CppSharp.Tests @@ -36,7 +36,7 @@ namespace CppSharp.Tests
{
driver.Generator.OnUnitGenerated += o =>
{
Block firstBlock = o.Templates[0].RootBlock.Blocks[1];
Block firstBlock = o.Outputs[0].RootBlock.Blocks[1];
firstBlock.WriteLine("using System.Runtime.CompilerServices;");
firstBlock.NewLine();
firstBlock.WriteLine("[assembly:InternalsVisibleTo(\"NamespacesDerived.CSharp\")]");

Loading…
Cancel
Save