Browse Source

Code formatting fixes.

pull/492/head
triton 10 years ago
parent
commit
95c34277a3
  1. 4
      src/Generator/AST/Utils.cs
  2. 23
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

4
src/Generator/AST/Utils.cs

@ -39,7 +39,7 @@ namespace CppSharp.AST @@ -39,7 +39,7 @@ namespace CppSharp.AST
if (method.Access == AccessSpecifier.Private && !method.IsOverride && !method.IsExplicitlyGenerated)
return true;
//Ignore copy constructor if a base class don't has or has a private copy constructor
// Ignore copy constructor if a base class don't has or has a private copy constructor
if (method.IsCopyConstructor)
{
if (!options.GenerateCopyConstructors)
@ -55,7 +55,7 @@ namespace CppSharp.AST @@ -55,7 +55,7 @@ namespace CppSharp.AST
if (copyConstructor == null
|| copyConstructor.Access == AccessSpecifier.Private
|| !copyConstructor.IsDeclared)
return true;
return true;
}
}
}

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

@ -99,7 +99,8 @@ namespace CppSharp.Generators.CSharp @@ -99,7 +99,8 @@ namespace CppSharp.Generators.CSharp
get { return "cs"; }
}
public CSharpTextTemplate(Driver driver, IEnumerable<TranslationUnit> units, CSharpTypePrinter typePrinter, CSharpExpressionPrinter expressionPrinter)
public CSharpTextTemplate(Driver driver, IEnumerable<TranslationUnit> units,
CSharpTypePrinter typePrinter, CSharpExpressionPrinter expressionPrinter)
: base(driver, units)
{
TypePrinter = typePrinter;
@ -487,7 +488,7 @@ namespace CppSharp.Generators.CSharp @@ -487,7 +488,7 @@ namespace CppSharp.Generators.CSharp
{
foreach (var field in @class.Fields)
{
GenerateClassField(field);
GenerateClassField(field);
}
}
@ -500,8 +501,7 @@ namespace CppSharp.Generators.CSharp @@ -500,8 +501,7 @@ namespace CppSharp.Generators.CSharp
GenerateClassInternalHead(@class);
WriteStartBraceIndent();
var typePrinter = TypePrinter;
typePrinter.PushContext(CSharpTypePrinterContextKind.Native);
TypePrinter.PushContext(CSharpTypePrinterContextKind.Native);
GenerateClassFields(@class, GenerateClassInternalsField, true);
if (@class.IsGenerated)
@ -512,18 +512,17 @@ namespace CppSharp.Generators.CSharp @@ -512,18 +512,17 @@ namespace CppSharp.Generators.CSharp
var functions = GatherClassInternalFunctions(@class);
foreach (var function in functions)
{
GenerateInternalFunction(function);
}
}
typePrinter.PopContext();
TypePrinter.PopContext();
WriteCloseBraceIndent();
PopBlock(NewLineKind.BeforeNextBlock);
}
private IEnumerable<Function> GatherClassInternalFunctions(Class @class, bool includeCtors = true)
private IEnumerable<Function> GatherClassInternalFunctions(Class @class,
bool includeCtors = true)
{
var functions = new List<Function>();
if (@class.IsValueType)
@ -780,7 +779,8 @@ namespace CppSharp.Generators.CSharp @@ -780,7 +779,8 @@ namespace CppSharp.Generators.CSharp
return Tuple.Create(library, decl.Mangled);
}
private void GeneratePropertySetter<T>(QualifiedType returnType, T decl, Class @class, bool isAbstract = false)
private void GeneratePropertySetter<T>(QualifiedType returnType, T decl,
Class @class, bool isAbstract = false)
where T : Declaration, ITypedDecl
{
if (!(decl is Function || decl is Field) )
@ -886,7 +886,7 @@ namespace CppSharp.Generators.CSharp @@ -886,7 +886,7 @@ namespace CppSharp.Generators.CSharp
if (marshal.Context.Return.StringBuilder.Length > 0)
{
WriteLine("{0} = {1};", ctx.ReturnVarName, marshal.Context.Return);
WriteLine("{0} = {1};", ctx.ReturnVarName, marshal.Context.Return);
}
if (arrayType != null && @class.IsValueType)
@ -936,7 +936,8 @@ namespace CppSharp.Generators.CSharp @@ -936,7 +936,8 @@ namespace CppSharp.Generators.CSharp
}
}
private void GeneratePropertyGetter<T>(QualifiedType returnType, T decl, Class @class, bool isAbstract = false)
private void GeneratePropertyGetter<T>(QualifiedType returnType, T decl,
Class @class, bool isAbstract = false)
where T : Declaration, ITypedDecl
{
PushBlock(CSharpBlockKind.Method);

Loading…
Cancel
Save