5#define __XTD_STD_INTERNAL__
7#undef __XTD_STD_INTERNAL__
9#include "../collections/generic/ienumerable.hpp"
11#include "../chrono.hpp"
12#include "../optional.hpp"
13#include "../types.hpp"
20#include <forward_list>
31#include <system_error>
35#include <unordered_map>
36#include <unordered_set>
47 template<
typename value_t>
48 inline std::string
to_string(
const value_t& value,
const std::string& fmt,
const std::locale& loc);
50 inline std::string
to_string(
const bool& value,
const std::string& fmt,
const std::locale& loc);
52 inline std::string
to_string(
const xtd::sbyte& value,
const std::string& fmt,
const std::locale& loc);
54 inline std::string
to_string(
const char& value,
const std::string& fmt,
const std::locale& loc);
56 inline std::string
to_string(
const unsigned char& value,
const std::string& fmt,
const std::locale& loc);
58 inline std::string
to_string(
const short& value,
const std::string& fmt,
const std::locale& loc);
60 inline std::string
to_string(
const unsigned short& value,
const std::string& fmt,
const std::locale& loc);
62 inline std::string
to_string(
const int& value,
const std::string& fmt,
const std::locale& loc);
64 inline std::string
to_string(
const unsigned int& value,
const std::string& fmt,
const std::locale& loc);
66 inline std::string
to_string(
const long& value,
const std::string& fmt,
const std::locale& loc);
68 inline std::string
to_string(
const unsigned long& value,
const std::string& fmt,
const std::locale& loc);
70 inline std::string
to_string(
const long long& value,
const std::string& fmt,
const std::locale& loc);
72 inline std::string
to_string(
const unsigned long long& value,
const std::string& fmt,
const std::locale& loc);
74 inline std::string
to_string(
const float& value,
const std::string& fmt,
const std::locale& loc);
76 inline std::string
to_string(
const double& value,
const std::string& fmt,
const std::locale& loc);
78 inline std::string
to_string(
const long double& value,
const std::string& fmt,
const std::locale& loc);
80 inline std::string
to_string(
const std::chrono::system_clock::time_point& value,
const std::string& fmt,
const std::locale& loc);
82 inline std::string
to_string(
const std::tm& value,
const std::string& fmt,
const std::locale& loc);
83 template<
typename type_t,
typename period_t = std::ratio<1>>
84 inline std::string
to_string(
const std::chrono::duration<type_t, period_t>& value,
const std::string& fmt,
const std::locale& loc);
85#if defined(__xtd__cpp_lib_char8_t)
87 inline std::string
to_string(
const xtd::char8& value,
const std::string& fmt,
const std::locale& loc);
90 inline std::string
to_string(
const xtd::char16& value,
const std::string& fmt,
const std::locale& loc);
92 inline std::string
to_string(
const xtd::char32& value,
const std::string& fmt,
const std::locale& loc);
94 inline std::string
to_string(
const xtd::wchar& value,
const std::string& fmt,
const std::locale& loc);
95#if defined(__xtd__cpp_lib_three_way_comparison)
97 inline std::string
to_string(
const std::partial_ordering& value,
const std::string& fmt,
const std::locale& loc);
99 inline std::string
to_string(
const std::strong_ordering& value,
const std::string& fmt,
const std::locale& loc);
101 inline std::string
to_string(
const std::weak_ordering& value,
const std::string& fmt,
const std::locale& loc);
103 template<
typename value_t>
104 inline std::string
to_string(
const value_t* value,
const std::string& fmt,
const std::locale& loc);
105 template<
typename value_t>
106 inline std::string
to_string(value_t*
const value,
const std::string& fmt,
const std::locale& loc);
107 template<
typename type_t>
108 inline std::string
to_string(
const std::shared_ptr<type_t>& value,
const std::string& fmt,
const std::locale& loc);
109 template<
typename type_t>
110 inline std::string
to_string(
const std::unique_ptr<type_t>& value,
const std::string& fmt,
const std::locale& loc);
112 inline std::string
to_string(
const std::any& value,
const std::string& fmt,
const std::locale& loc);
113 template<
typename types_t>
114 inline std::string
to_string(
const std::optional<types_t>& value,
const std::string& fmt,
const std::locale& loc);
116 inline std::string
to_string(
const std::nullopt_t& value,
const std::string& fmt,
const std::locale& loc);
117 template<
typename type1_t,
typename type2_t>
118 inline std::string
to_string(
const std::pair<type1_t, type2_t>& value,
const std::string& fmt,
const std::locale& loc);
119 template<
typename ... types_t>
120 inline std::string
to_string(
const std::tuple<types_t ...>& value,
const std::string& fmt,
const std::locale& loc);
121 template<
typename type_t,
size_t size>
122 inline std::string
to_string(
const std::array<type_t, size>& values,
const std::string& fmt,
const std::locale& loc);
123 template<
typename type_t,
typename allocator_t = std::allocator<type_t>>
124 inline std::string
to_string(
const std::deque<type_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
125 template<
typename type_t,
typename allocator_t = std::allocator<type_t>>
126 inline std::string
to_string(
const std::forward_list<type_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
127 template<
typename type_t>
128 inline std::string
to_string(
const std::initializer_list<type_t>& values,
const std::string& fmt,
const std::locale& loc);
129 template<
typename type_t,
typename allocator_t = std::allocator<type_t>>
130 inline std::string
to_string(
const std::list<type_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
131 template<
typename type_t>
132 inline std::string
to_string(
const std::valarray<type_t>& values,
const std::string& fmt,
const std::locale& loc);
133 template<
typename type_t,
typename allocator_t = std::allocator<type_t>>
134 inline std::string
to_string(
const std::vector<type_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
135 template<
typename key_t,
typename value_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<std::pair<const key_t, value_t>>>
136 inline std::string
to_string(
const std::map<key_t, value_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
137 template<
typename key_t,
typename value_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<std::pair<const key_t, value_t>>>
138 inline std::string
to_string(
const std::multimap<key_t, value_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
139 template<
typename key_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<key_t>>
140 inline std::string
to_string(
const std::multiset<key_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
141 template<
typename key_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<key_t>>
142 inline std::string
to_string(
const std::set<key_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
143 template<
typename key_t,
typename value_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<std::pair<const key_t, value_t>>>
144 inline std::string
to_string(
const std::unordered_map<key_t, value_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
145 template<
typename key_t,
typename value_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<std::pair<const key_t, value_t>>>
146 inline std::string
to_string(
const std::unordered_multimap<key_t, value_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
147 template<
typename key_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<key_t>>
148 inline std::string
to_string(
const std::unordered_multiset<key_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
149 template<
typename key_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<key_t>>
150 inline std::string
to_string(
const std::unordered_set<key_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
151 template<
typename type_t>
154 template<
typename value_t>
155 inline std::wstring
to_string(
const value_t& value,
const std::wstring& fmt,
const std::locale& loc);
157 inline std::wstring
to_string(
const bool& value,
const std::wstring& fmt,
const std::locale& loc);
159 inline std::wstring
to_string(
const xtd::sbyte& value,
const std::wstring& fmt,
const std::locale& loc);
161 inline std::wstring
to_string(
const char& value,
const std::wstring& fmt,
const std::locale& loc);
163 inline std::wstring
to_string(
const unsigned char& value,
const std::wstring& fmt,
const std::locale& loc);
165 inline std::wstring
to_string(
const short& value,
const std::wstring& fmt,
const std::locale& loc);
167 inline std::wstring
to_string(
const unsigned short& value,
const std::wstring& fmt,
const std::locale& loc);
169 inline std::wstring
to_string(
const int& value,
const std::wstring& fmt,
const std::locale& loc);
171 inline std::wstring
to_string(
const unsigned int& value,
const std::wstring& fmt,
const std::locale& loc);
173 inline std::wstring
to_string(
const long& value,
const std::wstring& fmt,
const std::locale& loc);
175 inline std::wstring
to_string(
const unsigned long& value,
const std::wstring& fmt,
const std::locale& loc);
177 inline std::wstring
to_string(
const long long& value,
const std::wstring& fmt,
const std::locale& loc);
179 inline std::wstring
to_string(
const unsigned long long& value,
const std::wstring& fmt,
const std::locale& loc);
181 inline std::wstring
to_string(
const float& value,
const std::wstring& fmt,
const std::locale& loc);
183 inline std::wstring
to_string(
const double& value,
const std::wstring& fmt,
const std::locale& loc);
185 inline std::wstring
to_string(
const long double& value,
const std::wstring& fmt,
const std::locale& loc);
187 inline std::wstring
to_string(
const std::chrono::system_clock::time_point& value,
const std::wstring& fmt,
const std::locale& loc);
189 inline std::wstring
to_string(
const std::tm& value,
const std::wstring& fmt,
const std::locale& loc);
191 template<
typename type_t,
typename period_t = std::ratio<1>>
192 inline std::wstring
to_string(
const std::chrono::duration<type_t, period_t>& value,
const std::wstring& fmt,
const std::locale& loc);
193#if defined(__xtd__cpp_lib_char8_t)
195 inline std::wstring
to_string(
const xtd::char8& value,
const std::wstring& fmt,
const std::locale& loc);
198 inline std::wstring
to_string(
const xtd::char16& value,
const std::wstring& fmt,
const std::locale& loc);
200 inline std::wstring
to_string(
const xtd::char32& value,
const std::wstring& fmt,
const std::locale& loc);
202 inline std::wstring
to_string(
const xtd::wchar& value,
const std::wstring& fmt,
const std::locale& loc);
204 template<
typename type_t,
typename string_t>
205 inline string_t
to_string(type_t value,
const std::map<type_t, string_t, std::greater<type_t>>& values) {
206 auto it = values.find(value);
207 if (it != values.end())
return it->second;
209 long long rest =
static_cast<long long>(value);
210 for (
auto item : values) {
211 if (
static_cast<long long>(item.first) != 0 && (rest &
static_cast<long long>(item.first)) ==
static_cast<long long>(item.first)) {
212 if (!result.empty()) result = string_t {
',',
' '} + result;
213 result = item.second + result;
214 rest -=
static_cast<long long>(item.first);
217 if (!result.empty())
return result;
218 return to_string(
static_cast<long long>(value), string_t {
'G'}, std::locale());
221 template<
typename type_t,
typename string_t>
222 inline string_t
to_string(type_t value,
const std::map<type_t, string_t>& values) {
223 std::map<type_t, string_t, std::greater<type_t>> descending_values;
224 for (
auto item : values) descending_values[item.first] = item.second;
225 return to_string(value, descending_values);
228 template<
typename type_t>
229 inline std::string
to_string(type_t value,
const std::initializer_list<std::pair<type_t, std::string>>& il) {
230 std::map<type_t, std::string, std::greater<type_t>> values;
231 for (
auto item : il) values[item.first] = item.second;
235 template<
typename type_t>
236 inline std::wstring
to_string(type_t value,
const std::initializer_list<std::pair<type_t, std::wstring>>& il) {
237 std::map<type_t, std::wstring, std::greater<type_t>> values;
238 for (
auto item : il) values[item.first] = item.second;
243template<
typename char_t>
244inline std::basic_string<char_t> __codepoint_to_string(
xtd::char32 codepoint) {
245 std::basic_string<char_t> result;
246 if (codepoint < 0x80)
247 result.push_back(
static_cast<char_t
>(codepoint));
248 else if (codepoint < 0x800) {
249 result.push_back(
static_cast<char_t
>((codepoint >> 6) | 0xc0));
250 result.push_back(
static_cast<char_t
>((codepoint & 0x3f) | 0x80));
251 }
else if (codepoint < 0x10000) {
252 result.push_back(
static_cast<char_t
>((codepoint >> 12) | 0xe0));
253 result.push_back(
static_cast<char_t
>(((codepoint >> 6) & 0x3f) | 0x80));
254 result.push_back(
static_cast<char_t
>((codepoint & 0x3f) | 0x80));
256 result.push_back(
static_cast<char_t
>((codepoint >> 18) | 0xf0));
257 result.push_back(
static_cast<char_t
>(((codepoint >> 12) & 0x3f) | 0x80));
258 result.push_back(
static_cast<char_t
>(((codepoint >> 6) & 0x3f) | 0x80));
259 result.push_back(
static_cast<char_t
>((codepoint & 0x3f) | 0x80));
264template<
typename char_t>
265inline std::basic_string<char_t> __to_string(
char codepoint) {
266 return __codepoint_to_string<char_t>(codepoint);
269template<
typename char_t>
270inline std::basic_string<char_t> __to_string(
xtd::char32 codepoint) {
271 return __codepoint_to_string<char_t>(codepoint);
274template<
typename char_t>
275inline std::basic_string<char_t> __to_string(
xtd::char16 codepoint) {
276 return __codepoint_to_string<char_t>(codepoint);
279#if defined(__xtd__cpp_lib_char8_t)
280template<
typename char_t>
281inline std::basic_string<char_t> __to_string(
xtd::char8 codepoint) {
282 return __codepoint_to_string<char_t>(codepoint);
286template<
typename char_t>
287inline std::basic_string<char_t> __to_string(
xtd::wchar codepoint) {
288 return __codepoint_to_string<char_t>(codepoint);
291template<
typename char_t>
292inline std::basic_string<char_t> __to_string(
const std::basic_string<char_t>& str) {
293 std::basic_string<char_t> result;
294 std::for_each(str.begin(), str.end(), [&](
auto codepoint) {result += __to_string<char_t>(codepoint);});
298template<
typename char_t,
typename arg_t>
299inline std::basic_string<char_t> __to_string(
const std::basic_string<arg_t>& str) {
300 std::basic_string<char_t> result;
301 for (
auto codepoint : str)
302 result += __to_string<char_t>(codepoint);
306template<
typename char_t,
typename arg_t>
307inline std::basic_string<char_t> __to_string(
const arg_t* str) {
308 std::basic_string<char_t> result;
309 for (
auto codepoint : std::basic_string<arg_t>(str))
310 result += __to_string<char_t>(codepoint);
314template<
typename char_t,
typename type_t,
typename period_t = std::ratio<1>>
315std::basic_ostream<char_t>& operator <<(std::basic_ostream<char_t>& os,
const std::chrono::duration<type_t, period_t>& value) {
316 return os <<
xtd::to_string(value, std::basic_string<char_t> {
'G'}, std::locale());
319#if defined(__xtd__cpp_lib_char8_t)
320std::ostream& operator <<(std::ostream& os,
const xtd::char8* str);
322std::ostream& operator <<(std::ostream& os,
const xtd::char16* str);
323std::ostream& operator <<(std::ostream& os,
const xtd::char32* str);
324std::ostream& operator <<(std::ostream& os,
const xtd::wchar* str);
326template<
typename enum_t>
327std::string __enum_to_string(enum_t value)
noexcept;
329std::string __object_to_string(
const xtd::object& value)
noexcept;
331template <
typename char_t,
typename type_t,
typename bool_t>
332struct __enum_ostream__ {};
334template <
typename char_t,
typename type_t>
335struct __enum_ostream__<char_t, type_t, std::true_type> {
336 std::basic_ostream<char_t>& to_stream(std::basic_ostream<char_t>& os,
const type_t& value)
noexcept {
337 return os << __enum_to_string(value);
341template <
typename char_t,
typename type_t>
342struct __enum_ostream__<char_t, type_t, std::false_type> {
343 std::basic_ostream<char_t>& to_stream(std::basic_ostream<char_t>& os,
const type_t& value)
noexcept {
345 return os <<
xtd::to_string(value, std::basic_string<char_t> {}, std::locale {});
349template <
typename char_t,
typename type_t,
typename bool_t>
350struct __enum_or_polymorphic_ostream__ {};
352template <
typename char_t,
typename type_t>
353struct __enum_or_polymorphic_ostream__<char_t, type_t, std::true_type> {
354 std::basic_ostream<char_t>& to_stream(std::basic_ostream<char_t>& os,
const type_t& value)
noexcept {
355 if (
dynamic_cast<const xtd::iformatable*
>(&value))
return os << __iformatable_to_string(dynamic_cast<const xtd::iformatable&>(value));
356 if (
dynamic_cast<const xtd::object*
>(&value))
return os << __object_to_string(
dynamic_cast<const xtd::object&
>(value));
361template <
typename char_t,
typename type_t>
362struct __enum_or_polymorphic_ostream__<char_t, type_t, std::false_type> {
363 std::basic_ostream<char_t>& to_stream(std::basic_ostream<char_t>& os,
const type_t& value)
noexcept {
364 __enum_ostream__<char, type_t, typename std::is_enum<type_t>::type>().to_stream(os, value);
369template<
typename value_t>
370std::string __format_stringer_to_std_string(
const value_t& value) {
371 std::basic_stringstream<char> ss;
373 __enum_or_polymorphic_ostream__<char, value_t, typename std::is_polymorphic<value_t>::type>().to_stream(ss, value);
377std::string __format_stringer_to_std_string(
const char& c);
378#if defined(__xtd__cpp_lib_char8_t)
379std::string __format_stringer_to_std_string(
const xtd::char8& c);
381std::string __format_stringer_to_std_string(
const xtd::char16& c);
382std::string __format_stringer_to_std_string(
const xtd::char32& c);
383std::string __format_stringer_to_std_string(
const xtd::wchar& c);
384std::string __format_stringer_to_std_string(
const char* str);
385#if defined(__xtd__cpp_lib_char8_t)
386std::string __format_stringer_to_std_string(
const xtd::char8* str);
388std::string __format_stringer_to_std_string(
const xtd::char16* str);
389std::string __format_stringer_to_std_string(
const xtd::char32* str);
390std::string __format_stringer_to_std_string(
const xtd::wchar* str);
391std::string __format_stringer_to_std_string(
const std::string& str);
392std::string __format_stringer_to_std_string(
const xtd::string& str);
393#if defined(__xtd__cpp_lib_char8_t)
394std::string __format_stringer_to_std_string(
const std::u8string& str);
396std::string __format_stringer_to_std_string(
const std::u16string& str);
397std::string __format_stringer_to_std_string(
const std::u32string& str);
398std::string __format_stringer_to_std_string(
const std::wstring& str);
400template<
typename char_t,
typename value_t>
401inline std::basic_string<char_t> __format_stringer(value_t value) {
402 std::basic_stringstream<char_t> ss;
403 ss << __format_stringer_to_std_string(value).c_str();
407template<
typename char_t,
typename value_t>
408inline std::basic_string<char_t> __format_stringer(
const bool& value) {
409 std::basic_stringstream<char_t> ss;
410 ss << std::boolalpha << value;
414template<
typename char_t,
typename value_t, xtd::
int32 len>
415inline std::basic_string<char_t> __format_stringer(
const char*& value) {
416 std::basic_stringstream<char_t> ss;
417 ss << __to_string<char_t>(value);
421template<
typename char_t,
typename value_t, xtd::
int32 len>
422inline std::basic_string<char_t> __format_stringer(
const char*
const& value) {
423 std::basic_stringstream<char_t> ss;
424 ss << __to_string<char_t>(value);
428#if defined(__xtd__cpp_lib_char8_t)
429template<
typename char_t,
typename value_t>
430inline std::basic_string<char_t> __format_stringer(
const xtd::char8*& value) {
431 auto s = std::u8string(value);
432 std::basic_stringstream<char_t> ss;
433 ss << std::basic_string<char_t>(
s.begin(),
s.end());
437template<
typename char_t,
typename value_t>
438inline std::basic_string<char_t> __format_stringer(
const xtd::char8*
const& value) {
439 auto s = std::u8string(value);
440 std::basic_stringstream<char_t> ss;
441 ss << std::basic_string<char_t>(
s.begin(),
s.end());
446template<
typename char_t,
typename value_t>
447inline std::basic_string<char_t> __format_stringer(
const xtd::char16*& value) {
448 std::basic_stringstream<char_t> ss;
449 ss << __to_string<char_t>(value);
453template<
typename char_t,
typename value_t>
454inline std::basic_string<char_t> __format_stringer(
const xtd::char16*
const& value) {
455 std::basic_stringstream<char_t> ss;
456 ss << __to_string<char_t>(value);
460template<
typename char_t,
typename value_t>
461inline std::basic_string<char_t> __format_stringer(
const xtd::char32*& value) {
462 std::basic_stringstream<char_t> ss;
463 ss << __to_string<char_t>(value);
467template<
typename char_t,
typename value_t>
468inline std::basic_string<char_t> __format_stringer(
const xtd::char32*
const& value) {
469 std::basic_stringstream<char_t> ss;
470 ss << __to_string<char_t>(value);
474template<
typename char_t,
typename value_t>
475inline std::basic_string<char_t> __format_stringer(
const xtd::wchar*& value) {
476 std::basic_stringstream<char_t> ss;
477 ss << __to_string<char_t>(value);
481template<
typename char_t,
typename value_t>
482inline std::basic_string<char_t> __format_stringer(
const xtd::wchar*
const& value) {
483 std::basic_stringstream<char_t> ss;
484 ss << __to_string<char_t>(value);
488#if defined(__xtd__cpp_lib_char8_t)
490inline std::string __format_stringer<char, std::u8string&>(std::u8string& value) {
491 std::basic_stringstream<char> ss;
492 ss << std::string(value.begin(), value.end());
498inline std::string __format_stringer<char, const std::u16string&>(
const std::u16string& value) {
499 std::basic_stringstream<char> ss;
500 ss << __to_string<char>(value);
505inline std::string __format_stringer<char, const std::u32string&>(
const std::u32string& value) {
506 std::basic_stringstream<char> ss;
507 ss << __to_string<char>(value);
512inline std::string __format_stringer<char, const std::wstring&>(
const std::wstring& value) {
513 std::basic_stringstream<char> ss;
514 ss << __to_string<char>(value);
519inline std::string __format_stringer<char, bool&>(
bool& value) {
524inline std::string __format_stringer<char, xtd::sbyte&>(
xtd::sbyte& value) {
529inline std::string __format_stringer<char, const unsigned char&>(
const unsigned char& value) {
534inline std::string __format_stringer<char, unsigned char&>(
unsigned char& value) {
539inline std::string __format_stringer<char, short&>(
short& value) {
544inline std::string __format_stringer<char, unsigned short&>(
unsigned short& value) {
549inline std::string __format_stringer<char, int&>(
int& value) {
554inline std::string __format_stringer<char, unsigned int&>(
unsigned int& value) {
559inline std::string __format_stringer<char, long&>(
long& value) {
564inline std::string __format_stringer<char, unsigned long&>(
unsigned long& value) {
569inline std::string __format_stringer<char, long long&>(
long long& value) {
574inline std::string __format_stringer<char, unsigned long long&>(
unsigned long long& value) {
579inline std::string __format_stringer<char, float&>(
float& value) {
584inline std::string __format_stringer<char, double&>(
double& value) {
589inline std::string __format_stringer<char, long double&>(
long double& value) {
594inline std::string __format_stringer<char, std::chrono::system_clock::time_point&> (std::chrono::system_clock::time_point& value) {
599inline std::string __format_stringer<char, std::tm&> (tm& value) {
604inline std::string __format_stringer<char, xtd::wchar&>(
xtd::wchar& value) {
608#if defined(__xtd__cpp_lib_char8_t)
610inline std::string __format_stringer<char, xtd::char8&>(
xtd::char8& value) {
616inline std::string __format_stringer<char, xtd::char16&>(
xtd::char16& value) {
621inline std::string __format_stringer<char, xtd::char32&>(
xtd::char32& value) {
625#if defined(__xtd__cpp_lib_char8_t)
627inline std::wstring __format_stringer<xtd::wchar, std::u8string&>(std::u8string& value) {
628 std::basic_stringstream<xtd::wchar> ss;
629 ss << std::wstring(value.begin(), value.end());
635inline std::wstring __format_stringer<xtd::wchar, const std::u16string&>(
const std::u16string& value) {
636 std::basic_stringstream<xtd::wchar> ss;
637 ss << __to_string<xtd::wchar>(value);
642inline std::wstring __format_stringer<xtd::wchar, const std::u32string&>(
const std::u32string& value) {
643 std::basic_stringstream<xtd::wchar> ss;
644 ss << __to_string<xtd::wchar>(value);
649inline std::wstring __format_stringer<xtd::wchar, const std::string&>(
const std::string& value) {
650 std::basic_stringstream<xtd::wchar> ss;
651 ss << __to_string<xtd::wchar>(value);
656inline std::wstring __format_stringer<xtd::wchar, bool&>(
bool& value) {
661inline std::wstring __format_stringer<xtd::wchar, xtd::sbyte&>(
xtd::sbyte& value) {
666inline std::wstring __format_stringer<xtd::wchar, char&>(
char& value) {
671inline std::wstring __format_stringer<xtd::wchar, unsigned char&>(
unsigned char& value) {
676inline std::wstring __format_stringer<xtd::wchar, short&>(
short& value) {
681inline std::wstring __format_stringer<xtd::wchar, unsigned short&>(
unsigned short& value) {
686inline std::wstring __format_stringer<xtd::wchar, int&>(
int& value) {
691inline std::wstring __format_stringer<xtd::wchar, unsigned int&>(
unsigned int& value) {
696inline std::wstring __format_stringer<xtd::wchar, long&>(
long& value) {
701inline std::wstring __format_stringer<xtd::wchar, unsigned long&>(
unsigned long& value) {
706inline std::wstring __format_stringer<xtd::wchar, long long&>(
long long& value) {
711inline std::wstring __format_stringer<xtd::wchar, unsigned long long&>(
unsigned long long& value) {
716inline std::wstring __format_stringer<xtd::wchar, float&>(
float& value) {
721inline std::wstring __format_stringer<xtd::wchar, double&>(
double& value) {
726inline std::wstring __format_stringer<xtd::wchar, long double&>(
long double& value) {
731inline std::wstring __format_stringer<xtd::wchar, std::chrono::system_clock::time_point&> (std::chrono::system_clock::time_point& value) {
736inline std::wstring __format_stringer<xtd::wchar, std::tm&> (tm& value) {
Contains string definitions.
Contains __xtd_std_version definitions.
Represents text as a sequence of character units.
Definition basic_string.hpp:79
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:36
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:42
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:27
wchar_t wchar
Represents a wide character.
Definition wchar.hpp:24
int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.hpp:23
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:26
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition to_string.hpp:41
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10