diff --git a/src/CppParser/Bootstrap/Bootstrap.cs b/src/CppParser/Bootstrap/Bootstrap.cs index 66c050b0..50bac19e 100644 --- a/src/CppParser/Bootstrap/Bootstrap.cs +++ b/src/CppParser/Bootstrap/Bootstrap.cs @@ -91,7 +91,7 @@ namespace CppSharp ctx.Options.GeneratorKind = GeneratorKind.CPlusPlus; var nativeCodeGen = new NativeParserCodeGenerator(ctx); - nativeCodeGen.CTypePrinter.PrintScopeKind = TypePrintScopeKind.Local; + nativeCodeGen.CTypePrinter.ScopeKind = TypePrintScopeKind.Local; nativeCodeGen.GenerateFilePreamble(CommentKind.BCPL); nativeCodeGen.NewLine(); @@ -134,7 +134,7 @@ namespace CppSharp ctx.Options.GeneratorKind = GeneratorKind.CPlusPlus; var nativeCodeGen = new NativeParserCodeGenerator(ctx); - nativeCodeGen.CTypePrinter.PrintScopeKind = TypePrintScopeKind.Local; + nativeCodeGen.CTypePrinter.ScopeKind = TypePrintScopeKind.Local; nativeCodeGen.GenerateFilePreamble(CommentKind.BCPL); nativeCodeGen.NewLine(); diff --git a/src/Generator.Tests/AST/TestAST.cs b/src/Generator.Tests/AST/TestAST.cs index 8ed970b0..2841aa4f 100644 --- a/src/Generator.Tests/AST/TestAST.cs +++ b/src/Generator.Tests/AST/TestAST.cs @@ -460,7 +460,7 @@ namespace CppSharp.Generator.Tests.AST [Test] public void TestPrintingConstPointerWithConstType() { - var cppTypePrinter = new CppTypePrinter { PrintScopeKind = TypePrintScopeKind.Qualified }; + var cppTypePrinter = new CppTypePrinter { ScopeKind = TypePrintScopeKind.Qualified }; var builtin = new BuiltinType(PrimitiveType.Char); var pointee = new QualifiedType(builtin, new TypeQualifiers { IsConst = true }); var pointer = new QualifiedType(new PointerType(pointee), new TypeQualifiers { IsConst = true }); @@ -472,7 +472,7 @@ namespace CppSharp.Generator.Tests.AST public void TestPrintingSpecializationWithConstValue() { var template = AstContext.FindDecl("TestSpecializationArguments").First(); - var cppTypePrinter = new CppTypePrinter { PrintScopeKind = TypePrintScopeKind.Qualified }; + var cppTypePrinter = new CppTypePrinter { ScopeKind = TypePrintScopeKind.Qualified }; Assert.That(template.Specializations.Last().Visit(cppTypePrinter).Type, Is.EqualTo("TestSpecializationArguments")); } @@ -515,7 +515,7 @@ namespace CppSharp.Generator.Tests.AST [Test] public void TestVolatile() { - var cppTypePrinter = new CppTypePrinter { PrintScopeKind = TypePrintScopeKind.Qualified }; + var cppTypePrinter = new CppTypePrinter { ScopeKind = TypePrintScopeKind.Qualified }; var builtin = new BuiltinType(PrimitiveType.Char); var pointee = new QualifiedType(builtin, new TypeQualifiers { IsConst = true, IsVolatile = true }); var type = pointee.Visit(cppTypePrinter).Type; @@ -533,7 +533,7 @@ namespace CppSharp.Generator.Tests.AST public void TestPrintNestedInSpecialization() { var template = AstContext.FindDecl("TestTemplateClass").First(); - var cppTypePrinter = new CppTypePrinter { PrintScopeKind = TypePrintScopeKind.Qualified }; + var cppTypePrinter = new CppTypePrinter { ScopeKind = TypePrintScopeKind.Qualified }; Assert.That(template.Specializations[3].Classes.First().Visit(cppTypePrinter).Type, Is.EqualTo("TestTemplateClass::NestedInTemplate")); } @@ -542,7 +542,7 @@ namespace CppSharp.Generator.Tests.AST public void TestPrintQualifiedSpecialization() { var functionWithSpecializationArg = AstContext.FindFunction("functionWithSpecializationArg").First(); - var cppTypePrinter = new CppTypePrinter { PrintScopeKind = TypePrintScopeKind.Qualified }; + var cppTypePrinter = new CppTypePrinter { ScopeKind = TypePrintScopeKind.Qualified }; Assert.That(functionWithSpecializationArg.Parameters[0].Visit(cppTypePrinter).Type, Is.EqualTo("const TestTemplateClass")); } diff --git a/src/Generator/Generators/C/CppTypePrinter.cs b/src/Generator/Generators/C/CppTypePrinter.cs index d1011f34..f8cbee00 100644 --- a/src/Generator/Generators/C/CppTypePrinter.cs +++ b/src/Generator/Generators/C/CppTypePrinter.cs @@ -16,7 +16,6 @@ namespace CppSharp.Generators.C public class CppTypePrinter : TypePrinter { public CppTypePrintFlavorKind PrintFlavorKind { get; set; } - public TypePrintScopeKind PrintScopeKind { get; set; } public bool PrintLogicalNames { get; set; } public bool PrintTypeQualifiers { get; set; } public bool PrintTypeModifiers { get; set; } @@ -25,7 +24,7 @@ namespace CppSharp.Generators.C public CppTypePrinter() { PrintFlavorKind = CppTypePrintFlavorKind.Cpp; - PrintScopeKind = TypePrintScopeKind.GlobalQualified; + ScopeKind = TypePrintScopeKind.GlobalQualified; PrintTypeQualifiers = true; PrintTypeModifiers = true; } @@ -370,7 +369,7 @@ namespace CppSharp.Generators.C public override TypePrinterResult VisitDeclaration(Declaration decl) { - return GetDeclName(decl, PrintScopeKind); + return GetDeclName(decl, ScopeKind); } public override TypePrinterResult VisitTranslationUnit(TranslationUnit unit) diff --git a/src/Generator/Generators/CSharp/CSharpSourcesExtensions.cs b/src/Generator/Generators/CSharp/CSharpSourcesExtensions.cs index 32a4cf2b..736c6779 100644 --- a/src/Generator/Generators/CSharp/CSharpSourcesExtensions.cs +++ b/src/Generator/Generators/CSharp/CSharpSourcesExtensions.cs @@ -98,7 +98,7 @@ namespace CppSharp.Generators.CSharp var names = new List { mapped.OriginalName }; foreach (TypePrintScopeKind kind in Enum.GetValues(typeof(TypePrintScopeKind))) { - var cppTypePrinter = new CppTypePrinter { PrintScopeKind = kind }; + var cppTypePrinter = new CppTypePrinter { ScopeKind = kind }; names.Add(mapped.Visit(cppTypePrinter)); } foreach (var name in names.Where(context.TypeMaps.TypeMaps.ContainsKey)) diff --git a/src/Generator/Passes/SymbolsCodeGenerator.cs b/src/Generator/Passes/SymbolsCodeGenerator.cs index 2a4643ed..212ee730 100644 --- a/src/Generator/Passes/SymbolsCodeGenerator.cs +++ b/src/Generator/Passes/SymbolsCodeGenerator.cs @@ -305,7 +305,7 @@ namespace CppSharp.Passes private CppTypePrinter cppTypePrinter = new CppTypePrinter { - PrintScopeKind = TypePrintScopeKind.Qualified + ScopeKind = TypePrintScopeKind.Qualified }; private int functionCount; } diff --git a/src/Generator/Types/TypeMapDatabase.cs b/src/Generator/Types/TypeMapDatabase.cs index 62f174b4..73f10f2c 100644 --- a/src/Generator/Types/TypeMapDatabase.cs +++ b/src/Generator/Types/TypeMapDatabase.cs @@ -93,7 +93,7 @@ namespace CppSharp.Types new[] { TypePrintScopeKind.Local, TypePrintScopeKind.Qualified }) { typePrinter.ResolveTypedefs = resolveTypeDefs; - typePrinter.PrintScopeKind = typePrintScopeKind; + typePrinter.ScopeKind = typePrintScopeKind; if (FindTypeMap(type.Visit(typePrinter), out typeMap)) { typeMap.Type = type;