|
|
|
@ -12,12 +12,12 @@ namespace CppSharp.Types.Std
@@ -12,12 +12,12 @@ namespace CppSharp.Types.Std
|
|
|
|
|
[TypeMap("const char*", GeneratorKindID = GeneratorKind.CLI_ID)] |
|
|
|
|
public partial class ConstCharPointer : TypeMap |
|
|
|
|
{ |
|
|
|
|
public override Type CLISignatureType(TypePrinterContext ctx) |
|
|
|
|
public override Type SignatureType(TypePrinterContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
return new CILType(typeof(string)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToNative(MarshalContext ctx) |
|
|
|
|
public override void MarshalToNative(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
ctx.Before.WriteLine( |
|
|
|
|
"auto _{0} = clix::marshalString<clix::E_UTF8>({1});", |
|
|
|
@ -26,7 +26,7 @@ namespace CppSharp.Types.Std
@@ -26,7 +26,7 @@ namespace CppSharp.Types.Std
|
|
|
|
|
ctx.Return.Write("_{0}.c_str()", ctx.ArgName); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToManaged(MarshalContext ctx) |
|
|
|
|
public override void MarshalToManaged(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
if (ctx.Parameter != null && !ctx.Parameter.IsOut && |
|
|
|
|
!ctx.Parameter.IsInOut) |
|
|
|
@ -85,18 +85,18 @@ namespace CppSharp.Types.Std
@@ -85,18 +85,18 @@ namespace CppSharp.Types.Std
|
|
|
|
|
[TypeMap("basic_string<char, char_traits<char>, allocator<char>>", GeneratorKindID = GeneratorKind.CLI_ID)] |
|
|
|
|
public partial class String : TypeMap |
|
|
|
|
{ |
|
|
|
|
public override Type CLISignatureType(TypePrinterContext ctx) |
|
|
|
|
public override Type SignatureType(TypePrinterContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
return new CILType(typeof(string)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToNative(MarshalContext ctx) |
|
|
|
|
public override void MarshalToNative(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
ctx.Return.Write("clix::marshalString<clix::E_UTF8>({0})", |
|
|
|
|
ctx.Parameter.Name); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToManaged(MarshalContext ctx) |
|
|
|
|
public override void MarshalToManaged(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
ctx.Return.Write("clix::marshalString<clix::E_UTF8>({0})", |
|
|
|
|
ctx.ReturnVarName); |
|
|
|
@ -106,18 +106,18 @@ namespace CppSharp.Types.Std
@@ -106,18 +106,18 @@ namespace CppSharp.Types.Std
|
|
|
|
|
[TypeMap("std::wstring", GeneratorKindID = GeneratorKind.CLI_ID)] |
|
|
|
|
public partial class WString : TypeMap |
|
|
|
|
{ |
|
|
|
|
public override Type CLISignatureType(TypePrinterContext ctx) |
|
|
|
|
public override Type SignatureType(TypePrinterContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
return new CILType(typeof(string)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToNative(MarshalContext ctx) |
|
|
|
|
public override void MarshalToNative(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
ctx.Return.Write("clix::marshalString<clix::E_UTF16>({0})", |
|
|
|
|
ctx.Parameter.Name); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToManaged(MarshalContext ctx) |
|
|
|
|
public override void MarshalToManaged(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
ctx.Return.Write("clix::marshalString<clix::E_UTF16>({0})", |
|
|
|
|
ctx.ReturnVarName); |
|
|
|
@ -145,13 +145,13 @@ namespace CppSharp.Types.Std
@@ -145,13 +145,13 @@ namespace CppSharp.Types.Std
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override Type CLISignatureType(TypePrinterContext ctx) |
|
|
|
|
public override Type SignatureType(TypePrinterContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
return new CustomType( |
|
|
|
|
$"::System::Collections::Generic::List<{ctx.GetTemplateParameterList()}>^"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToNative(MarshalContext ctx) |
|
|
|
|
public override void MarshalToNative(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
var desugared = Type.Desugar(); |
|
|
|
|
var templateType = desugared as TemplateSpecializationType; |
|
|
|
@ -209,7 +209,7 @@ namespace CppSharp.Types.Std
@@ -209,7 +209,7 @@ namespace CppSharp.Types.Std
|
|
|
|
|
ctx.Return.Write(tmpVarName); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToManaged(MarshalContext ctx) |
|
|
|
|
public override void MarshalToManaged(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
var desugared = Type.Desugar(); |
|
|
|
|
var templateType = desugared as TemplateSpecializationType; |
|
|
|
@ -263,7 +263,7 @@ namespace CppSharp.Types.Std
@@ -263,7 +263,7 @@ namespace CppSharp.Types.Std
|
|
|
|
|
{ |
|
|
|
|
public override bool IsIgnored { get { return true; } } |
|
|
|
|
|
|
|
|
|
public override Type CLISignatureType(TypePrinterContext ctx) |
|
|
|
|
public override Type SignatureType(TypePrinterContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
var type = Type as TemplateSpecializationType; |
|
|
|
|
return new CustomType( |
|
|
|
@ -271,26 +271,15 @@ namespace CppSharp.Types.Std
@@ -271,26 +271,15 @@ namespace CppSharp.Types.Std
|
|
|
|
|
type.Arguments[0].Type}, {type.Arguments[1].Type}>^");
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToNative(MarshalContext ctx) |
|
|
|
|
public override void MarshalToNative(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
throw new System.NotImplementedException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToManaged(MarshalContext ctx) |
|
|
|
|
public override void MarshalToManaged(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
throw new System.NotImplementedException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override Type CSharpSignatureType(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("std::list", GeneratorKindID = GeneratorKind.CLI_ID)] |
|
|
|
@ -308,12 +297,12 @@ namespace CppSharp.Types.Std
@@ -308,12 +297,12 @@ namespace CppSharp.Types.Std
|
|
|
|
|
[TypeMap("basic_ostream<char, char_traits<char>>", GeneratorKind.CLI_ID)] |
|
|
|
|
public partial class OStream : TypeMap |
|
|
|
|
{ |
|
|
|
|
public override Type CLISignatureType(TypePrinterContext ctx) |
|
|
|
|
public override Type SignatureType(TypePrinterContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
return new CILType(typeof(System.IO.TextWriter)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void CLIMarshalToNative(MarshalContext ctx) |
|
|
|
|
public override void MarshalToNative(MarshalContext ctx, GeneratorKind kind) |
|
|
|
|
{ |
|
|
|
|
var marshal = (CLIMarshalManagedToNativePrinter)ctx.MarshalToNative; |
|
|
|
|
if (!ctx.Parameter.Type.Desugar().IsPointer()) |
|
|
|
|