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
106 {
return a > b ?
a : b; }
112 template <
typename T>
114 ->
typename std::enable_if<!std::is_scalar<T>::value,
T>::type
115 {
return a > b ?
a : b; }
121 template <
typename T>
122 static constexpr auto Min(
T a,
T b)
noexcept
123 ->
typename std::enable_if<std::is_scalar<T>::value,
T>::type
124 {
return a < b ?
a : b; }
130 template <
typename T>
132 ->
typename std::enable_if<!std::is_scalar<T>::value,
T>::type
133 {
return a < b ?
a : b; }
138 template <
typename...
Args>
141 std::wstringstream
wss;
142 int _[]{(_BuildStr(
wss,
args), 0)...};
150 template <
typename T>
151 static auto _BuildStr(std::wostream &
wos,
const T &
arg)
158 template <
typename T>
159 static auto _BuildStr(std::wostream &wos,
const T &arg)
160 ->
typename std::enable_if<!_IsProperty<T>::value && _HasToString<T>::value>::type
161 { _BuildStr(wos, arg.ToString()); }
166 template <
typename T>
167 static auto _BuildStr(std::wostream &wos,
const T &prop)
168 ->
typename std::enable_if<_IsProperty<T>::value>::type
169 { _BuildStr(wos, prop.Get()); }
174 static void _BuildStr(std::wostream &wos,
bool b)
175 { wos << (b ?
L"true" :
L"false"); }
180 static void _BuildStr(std::wostream &wos,
const char *str)
186 static void _BuildStr(std::wostream &wos,
const std::string &str)
192 template <
typename T>
193 static void _BuildStr(std::wostream &wos,
const std::vector<T> &vec)
195 auto beg = vec.begin();
196 auto end = vec.end();
198 for (
auto it = beg; it != end; ++it) {
209 template <
typename TKey,
typename TVal>
210 static void _BuildStr(std::wostream &wos,
const std::map<TKey, TVal> &map)
212 auto beg = map.begin();
213 auto end = map.end();
215 for (
auto it = beg; it != end; ++it) {
218 _BuildStr(wos, it->first);
220 _BuildStr(wos, it->second);
228 template <
typename TKey,
typename TVal>
229 static void _BuildStr(std::wostream &wos,
const std::unordered_map<TKey, TVal> &map)
231 auto beg = map.begin();
232 auto end = map.end();
234 for (
auto it = beg; it != end; ++it) {
237 _BuildStr(wos, it->first);
239 _BuildStr(wos, it->second);