66 static std::wstring
Trim(
const std::wstring &
str);
88 static std::vector<std::wstring>
Split(
const std::wstring &
str,
const std::wstring &
delimiter);
103 template <
typename T>
104 static constexpr auto Max(
T a,
T b)
noexcept
105 ->
typename std::enable_if<std::is_scalar<T>::value,
T>::type
107 return a > b ?
a : b;
114 template <
typename T>
116 ->
typename std::enable_if<!std::is_scalar<T>::value,
T>::type
118 return a > b ?
a : b;
125 template <
typename T>
126 static constexpr auto Min(
T a,
T b)
noexcept
127 ->
typename std::enable_if<std::is_scalar<T>::value,
T>::type
129 return a < b ?
a : b;
136 template <
typename T>
138 ->
typename std::enable_if<!std::is_scalar<T>::value,
T>::type
140 return a < b ?
a : b;
146 template <
typename...
Args>
149 std::wstringstream
wss;
150 int _[]{(_BuildStr(
wss,
args), 0)...};
158 template <
typename T>
159 static auto _BuildStr(std::wostream &
wos,
const T &
arg)
168 template <
typename T>
169 static auto _BuildStr(std::wostream &wos,
const T &arg)
170 ->
typename std::enable_if<!_IsProperty<T>::value && _HasToString<T>::value>::type
172 _BuildStr(wos, arg.ToString());
178 template <
typename T>
179 static auto _BuildStr(std::wostream &wos,
const T &prop)
180 ->
typename std::enable_if<_IsProperty<T>::value>::type
182 _BuildStr(wos, prop.Get());
188 static void _BuildStr(std::wostream &wos,
bool b)
190 wos << (b ?
L"true" :
L"false");
196 static void _BuildStr(std::wostream &wos,
const char *str)
204 static void _BuildStr(std::wostream &wos,
const std::string &str)
212 template <
typename T>
213 static void _BuildStr(std::wostream &wos,
const std::vector<T> &vec)
215 auto beg = vec.begin();
216 auto end = vec.end();
218 for (
auto it = beg; it != end; ++it) {
229 template <
typename TKey,
typename TVal>
230 static void _BuildStr(std::wostream &wos,
const std::map<TKey, TVal> &map)
232 auto beg = map.begin();
233 auto end = map.end();
235 for (
auto it = beg; it != end; ++it) {
238 _BuildStr(wos, it->first);
240 _BuildStr(wos, it->second);
248 template <
typename TKey,
typename TVal>
249 static void _BuildStr(std::wostream &wos,
const std::unordered_map<TKey, TVal> &map)
251 auto beg = map.begin();
252 auto end = map.end();
254 for (
auto it = beg; it != end; ++it) {
257 _BuildStr(wos, it->first);
259 _BuildStr(wos, it->second);