From fdf796d7afbee96bc1b7b1bc1f8ff671ee4b593a Mon Sep 17 00:00:00 2001 From: Deadlocklogic Date: Tue, 5 Dec 2023 09:34:04 +0200 Subject: [PATCH] Stdlib.CSharp.cs: move std::map typemap from Stdlib.CLI.cs --- src/Generator/Types/Std/Stdlib.CSharp.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Generator/Types/Std/Stdlib.CSharp.cs b/src/Generator/Types/Std/Stdlib.CSharp.cs index e69de8e7..a4198bcd 100644 --- a/src/Generator/Types/Std/Stdlib.CSharp.cs +++ b/src/Generator/Types/Std/Stdlib.CSharp.cs @@ -412,6 +412,22 @@ namespace CppSharp.Types.Std.CSharp } } + [TypeMap("std::map", GeneratorKindID = GeneratorKind.CSharp_ID)] + public class Map : TypeMap + { + public override bool IsIgnored { get { return true; } } + + public override Type SignatureType(TypePrinterContext ctx) + { + if (ctx.Kind == TypePrinterContextKind.Native) + return new CustomType("Std.Map"); + + var type = Type as TemplateSpecializationType; + return new CustomType( + $@"System.Collections.Generic.Dictionary<{type.Arguments[0].Type}, {type.Arguments[1].Type}>"); + } + } + [TypeMap("FILE", GeneratorKindID = GeneratorKind.CSharp_ID)] public class FILE : TypeMap {