2017-10-10 23:32:13 +02:00
|
|
|
#pragma once
|
|
|
|
|
2017-10-16 17:50:09 +02:00
|
|
|
#include <locale>
|
|
|
|
#include <codecvt>
|
2017-10-10 23:32:13 +02:00
|
|
|
#include <string>
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
namespace dxvk::str {
|
|
|
|
|
|
|
|
inline void format1(std::stringstream&) { }
|
|
|
|
|
|
|
|
template<typename T, typename... Tx>
|
|
|
|
void format1(std::stringstream& str, const T& arg, const Tx&... args) {
|
|
|
|
str << arg;
|
|
|
|
format1(str, args...);
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename... Args>
|
|
|
|
std::string format(const Args&... args) {
|
|
|
|
std::stringstream stream;
|
|
|
|
format1(stream, args...);
|
|
|
|
return stream.str();
|
|
|
|
}
|
|
|
|
|
2017-10-16 17:50:09 +02:00
|
|
|
inline std::string fromws(const std::wstring& ws) {
|
|
|
|
return std::wstring_convert<std::codecvt_utf8<wchar_t>>().to_bytes(ws);
|
|
|
|
}
|
|
|
|
|
2017-10-10 23:32:13 +02:00
|
|
|
}
|