mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-03 22:24:13 +01:00
[util] Implement tows method to convert strings to wide strings
This commit is contained in:
parent
746562de5a
commit
629238ac36
@ -22,4 +22,20 @@ namespace dxvk::str {
|
|||||||
&result.at(0), len, nullptr, nullptr);
|
&result.at(0), len, nullptr, nullptr);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::vector<WCHAR> tows(const std::string& str) {
|
||||||
|
int strLen = ::MultiByteToWideChar(
|
||||||
|
CP_ACP, 0, str.c_str(), str.length() + 1,
|
||||||
|
nullptr, 0);
|
||||||
|
|
||||||
|
std::vector<WCHAR> wideStr(strLen);
|
||||||
|
|
||||||
|
::MultiByteToWideChar(
|
||||||
|
CP_ACP, 0, str.c_str(), str.length() + 1,
|
||||||
|
wideStr.data(), strLen);
|
||||||
|
|
||||||
|
return wideStr;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "./com/com_include.h"
|
#include "./com/com_include.h"
|
||||||
|
|
||||||
@ -9,6 +10,8 @@ namespace dxvk::str {
|
|||||||
|
|
||||||
std::string fromws(const WCHAR *ws);
|
std::string fromws(const WCHAR *ws);
|
||||||
|
|
||||||
|
std::vector<WCHAR> tows(const std::string& str);
|
||||||
|
|
||||||
inline void format1(std::stringstream&) { }
|
inline void format1(std::stringstream&) { }
|
||||||
|
|
||||||
template<typename... Tx>
|
template<typename... Tx>
|
||||||
|
Loading…
Reference in New Issue
Block a user