Browse Source

Ported the C# generator to Roslyn.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
roslyn
Dimitar Dobrev 10 years ago
parent
commit
9880ff9799
  1. 1045
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  2. 6
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs

1045
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

File diff suppressed because it is too large Load Diff

6
src/Generator/Generators/CSharp/CSharpTypePrinter.cs

@ -139,16 +139,14 @@ namespace CppSharp.Generators.CSharp
{ {
return new CSharpTypePrinterResult() return new CSharpTypePrinterResult()
{ {
Type = "fixed byte", Type = "byte",
NameSuffix = string.Format("[{0}]", array.Size * @class.Layout.Size) NameSuffix = string.Format("[{0}]", array.Size * @class.Layout.Size)
}; };
} }
// Do not write the fixed keyword multiple times for nested array types
var fixedKeyword = array.Type is ArrayType ? string.Empty : "fixed ";
return new CSharpTypePrinterResult() return new CSharpTypePrinterResult()
{ {
Type = string.Format("{0}{1}", fixedKeyword, array.Type.Visit(this, quals)), Type = array.Type.Visit(this, quals).Type,
NameSuffix = string.Format("[{0}]", array.Size) NameSuffix = string.Format("[{0}]", array.Size)
}; };
} }

Loading…
Cancel
Save