Browse Source

Minor code formatting changes.

pull/761/head
Joao Matos 9 years ago
parent
commit
dc998d391e
  1. 8
      src/AST/Module.cs
  2. 3
      src/Generator/Generators/CSharp/CSharpTypePrinter.cs

8
src/AST/Module.cs

@ -33,11 +33,11 @@ namespace CppSharp.AST
if (string.IsNullOrEmpty(inlinesLibraryName)) if (string.IsNullOrEmpty(inlinesLibraryName))
{ {
if (string.IsNullOrEmpty(OutputNamespace)) if (string.IsNullOrEmpty(OutputNamespace))
{
return string.Format("{0}-inlines", LibraryName); return string.Format("{0}-inlines", LibraryName);
}
return string.Format("{0}-inlines", OutputNamespace); return string.Format("{0}-inlines", OutputNamespace);
} }
return inlinesLibraryName; return inlinesLibraryName;
} }
set { inlinesLibraryName = value; } set { inlinesLibraryName = value; }
@ -50,11 +50,11 @@ namespace CppSharp.AST
if (string.IsNullOrEmpty(templatesLibraryName)) if (string.IsNullOrEmpty(templatesLibraryName))
{ {
if (string.IsNullOrEmpty(OutputNamespace)) if (string.IsNullOrEmpty(OutputNamespace))
{
return string.Format("{0}-templates", LibraryName); return string.Format("{0}-templates", LibraryName);
}
return string.Format("{0}-templates", OutputNamespace); return string.Format("{0}-templates", OutputNamespace);
} }
return templatesLibraryName; return templatesLibraryName;
} }
set { templatesLibraryName = value; } set { templatesLibraryName = value; }

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

@ -704,8 +704,10 @@ namespace CppSharp.Generators.CSharp
names.Push(decl.Name); names.Push(decl.Name);
ctx = decl.Namespace; ctx = decl.Namespace;
} }
if (decl is Variable && !(decl.Namespace is Class)) if (decl is Variable && !(decl.Namespace is Class))
names.Push(decl.TranslationUnit.FileNameWithoutExtension); names.Push(decl.TranslationUnit.FileNameWithoutExtension);
while (!(ctx is TranslationUnit)) while (!(ctx is TranslationUnit))
{ {
if (!string.IsNullOrWhiteSpace(ctx.Name)) if (!string.IsNullOrWhiteSpace(ctx.Name))
@ -713,6 +715,7 @@ namespace CppSharp.Generators.CSharp
ctx = ctx.Namespace; ctx = ctx.Namespace;
} }
if (!ctx.TranslationUnit.IsSystemHeader && ctx.TranslationUnit.IsValid && if (!ctx.TranslationUnit.IsSystemHeader && ctx.TranslationUnit.IsValid &&
!string.IsNullOrWhiteSpace(ctx.TranslationUnit.Module.OutputNamespace)) !string.IsNullOrWhiteSpace(ctx.TranslationUnit.Module.OutputNamespace))
names.Push(ctx.TranslationUnit.Module.OutputNamespace); names.Push(ctx.TranslationUnit.Module.OutputNamespace);

Loading…
Cancel
Save