aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-09-27 16:44:30 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-09-27 16:44:49 +0300
commit68c45ee5bb9c998923f7a8ce7857128803dbe93a (patch)
tree73f3cca98f183577cfaa3139be2cb876dd4a480a /src
parentdocs: refine Doxygen comments (diff)
downloadwinapi-utf8-68c45ee5bb9c998923f7a8ce7857128803dbe93a.tar.gz
winapi-utf8-68c45ee5bb9c998923f7a8ce7857128803dbe93a.zip
add a std::u16string overload
Diffstat (limited to 'src')
-rw-r--r--src/convert.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/convert.cpp b/src/convert.cpp
index bacea60..4ccc3a0 100644
--- a/src/convert.cpp
+++ b/src/convert.cpp
@@ -130,6 +130,10 @@ std::string narrow(const std::wstring& src) {
return narrow(src.c_str(), src.size() * sizeof(std::wstring::value_type));
}
+std::string narrow(const std::u16string& src) {
+ return narrow(src.c_str(), src.size() * sizeof(std::u16string::value_type));
+}
+
std::string narrow(const void* src, std::size_t in_nb) {
const DWORD flags = WC_ERR_INVALID_CHARS;