2017-10-10 23:32:13 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <sstream>
|
2019-02-11 21:35:32 +01:00
|
|
|
#include <vector>
|
2018-07-21 12:51:50 +02:00
|
|
|
|
2018-07-21 13:43:33 +03:00
|
|
|
#include "./com/com_include.h"
|
2017-10-10 23:32:13 +02:00
|
|
|
|
|
|
|
namespace dxvk::str {
|
|
|
|
|
2018-08-27 14:15:34 +02:00
|
|
|
std::string fromws(const WCHAR *ws);
|
2019-02-11 21:35:32 +01:00
|
|
|
|
|
|
|
std::vector<WCHAR> tows(const std::string& str);
|
2017-10-10 23:32:13 +02:00
|
|
|
|
2018-08-27 14:15:34 +02:00
|
|
|
inline void format1(std::stringstream&) { }
|
|
|
|
|
|
|
|
template<typename... Tx>
|
|
|
|
void format1(std::stringstream& str, const WCHAR *arg, const Tx&... args) {
|
|
|
|
str << fromws(arg);
|
|
|
|
format1(str, args...);
|
|
|
|
}
|
|
|
|
|
2017-10-10 23:32:13 +02:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|