diff --git a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std-symbols.cpp b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std-symbols.cpp index 682e399117..9647c2f875 100644 --- a/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std-symbols.cpp +++ b/src/CppParser/Bindings/CSharp/x86_64-pc-win32-msvc/Std-symbols.cpp @@ -9,3 +9,9 @@ template __declspec(dllexport) std::basic_string, s template __declspec(dllexport) std::basic_string, std::allocator>::~basic_string() noexcept; template __declspec(dllexport) std::basic_string, std::allocator>& std::basic_string, std::allocator>::assign(const char* const); template __declspec(dllexport) const char* std::basic_string, std::allocator>::data() const noexcept; + +template __declspec(dllexport) std::allocator::allocator() noexcept; +template __declspec(dllexport) std::basic_string, std::allocator>::basic_string() noexcept(true); +template __declspec(dllexport) std::basic_string, std::allocator>::~basic_string() noexcept; +template __declspec(dllexport) std::basic_string, std::allocator>& std::basic_string, std::allocator>::assign(const wchar_t* const); +template __declspec(dllexport) const wchar_t* std::basic_string, std::allocator>::data() const noexcept; diff --git a/src/Generator/Types/Std/Stdlib.CLI.cs b/src/Generator/Types/Std/Stdlib.CLI.cs index c68981b287..67b66ce1eb 100644 --- a/src/Generator/Types/Std/Stdlib.CLI.cs +++ b/src/Generator/Types/Std/Stdlib.CLI.cs @@ -103,7 +103,7 @@ public override void CLIMarshalToManaged(MarshalContext ctx) } } - [TypeMap("std::wstring", GeneratorKind = GeneratorKind.CLI)] + [TypeMap("basic_string, allocator>", GeneratorKind = GeneratorKind.CLI)] public partial class WString : TypeMap { public override Type CLISignatureType(TypePrinterContext ctx) diff --git a/tests/Common/Common.Tests.cs b/tests/Common/Common.Tests.cs index 7d481cd0f9..28e468c2f6 100644 --- a/tests/Common/Common.Tests.cs +++ b/tests/Common/Common.Tests.cs @@ -1020,15 +1020,16 @@ This is a very long string. This is a very long string. This is a very long stri using (var hasStdWString = new HasStdWString()) { + Assert.That(hasStdWString.TestStdWStringPassedByValue(t), Is.EqualTo(t + "_test")); Assert.That(hasStdWString.TestStdWString(t), Is.EqualTo(t + "_test")); hasStdWString.S = t; Assert.That(hasStdWString.S, Is.EqualTo(t)); Assert.That(hasStdWString.StdWString, Is.EqualTo(t)); - Assert.That(hasStdWString.StdWString, Is.EqualTo(t) + Assert.That(hasStdWString.StdWString, Is.EqualTo(t)); Assert.That(hasStdWString.TestStdWString(unicodeString1), Is.EqualTo(unicodeString1 + "_test")); hasStdWString.S = unicodeString1; Assert.That(hasStdWString.S, Is.EqualTo(unicodeString1)); - Assert.That(hasStdWString.StdWString, Is.EqualTo(unicodeString1) + Assert.That(hasStdWString.StdWString, Is.EqualTo(unicodeString1)); Assert.That(hasStdWString.TestStdWString(unicodeString2), Is.EqualTo(unicodeString2 + "_test")); hasStdWString.S = unicodeString2; Assert.That(hasStdWString.S, Is.EqualTo(unicodeString2));