1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-16 01:29:14 +01:00
dxvk/src/util/util_string.h

37 lines
759 B
C++

#pragma once
#include <string>
#include <sstream>
#include <vector>
#include "./com/com_include.h"
namespace dxvk::str {
std::string fromws(const WCHAR *ws);
std::vector<WCHAR> tows(const std::string& str);
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...);
}
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();
}
}