diff options
author | Friedemann Kleint <[email protected]> | 2021-09-28 13:51:34 +0200 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2021-09-29 21:16:29 +0200 |
commit | 8bb2f21b90fe0f2127ed8e8f46b448a30cf4a1b9 (patch) | |
tree | 7ce642a43f38beaf768a5e5e305c498867a643ac /sources/shiboken6/tests/libsample | |
parent | a6952accddd216f3577afd9efcc3700bccd9c88a (diff) |
shiboken6: Add support for std::wstring
Add a new header/source with conversion functions for
std::string/wstring. This avoids calling std::string::c_str()
which might do an allocation.
[ChangeLog][shiboken6] Support for std::wstring has been added.
Task-number: PYSIDE-1660
Task-number: PYSIDE-1666
Change-Id: If2b0fd1bd14b71d0c576921a889ac7e28ead00eb
Reviewed-by: Christian Tismer <[email protected]>
Diffstat (limited to 'sources/shiboken6/tests/libsample')
-rw-r--r-- | sources/shiboken6/tests/libsample/functions.cpp | 5 | ||||
-rw-r--r-- | sources/shiboken6/tests/libsample/functions.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/functions.cpp b/sources/shiboken6/tests/libsample/functions.cpp index 6b44a44c0..ffa3722b7 100644 --- a/sources/shiboken6/tests/libsample/functions.cpp +++ b/sources/shiboken6/tests/libsample/functions.cpp @@ -258,3 +258,8 @@ string addStdStrings(const std::string &s1, const std::string &s2) { return s1 + s2; } + +std::wstring addStdWStrings(const std::wstring &s1, const std::wstring &s2) +{ + return s1 + s2; +} diff --git a/sources/shiboken6/tests/libsample/functions.h b/sources/shiboken6/tests/libsample/functions.h index bedbf2ed4..46ccd196c 100644 --- a/sources/shiboken6/tests/libsample/functions.h +++ b/sources/shiboken6/tests/libsample/functions.h @@ -87,6 +87,7 @@ LIBSAMPLE_API int sumIntMatrix(int m[2][3]); LIBSAMPLE_API double sumDoubleMatrix(double m[2][3]); LIBSAMPLE_API std::string addStdStrings(const std::string &s1, const std::string &s2); +LIBSAMPLE_API std::wstring addStdWStrings(const std::wstring &s1, const std::wstring &s2); class LIBSAMPLE_API ArrayModifyTest { |