5#define __XTD_STD_INTERNAL__
7#undef __XTD_STD_INTERNAL__
10#include "../chrono.hpp"
11#include "../optional.hpp"
12#include "../types.hpp"
19#include <forward_list>
30#include <system_error>
34#include <unordered_map>
35#include <unordered_set>
46 template<
typename value_t>
47 inline std::string
to_string(
const value_t& value,
const std::string& fmt,
const std::locale& loc);
49 inline std::string
to_string(
const bool& value,
const std::string& fmt,
const std::locale& loc);
51 inline std::string
to_string(
const xtd::sbyte& value,
const std::string& fmt,
const std::locale& loc);
53 inline std::string
to_string(
const char& value,
const std::string& fmt,
const std::locale& loc);
55 inline std::string
to_string(
const unsigned char& value,
const std::string& fmt,
const std::locale& loc);
57 inline std::string
to_string(
const short& value,
const std::string& fmt,
const std::locale& loc);
59 inline std::string
to_string(
const unsigned short& value,
const std::string& fmt,
const std::locale& loc);
61 inline std::string
to_string(
const int& value,
const std::string& fmt,
const std::locale& loc);
63 inline std::string
to_string(
const unsigned int& value,
const std::string& fmt,
const std::locale& loc);
65 inline std::string
to_string(
const long& value,
const std::string& fmt,
const std::locale& loc);
67 inline std::string
to_string(
const unsigned long& value,
const std::string& fmt,
const std::locale& loc);
69 inline std::string
to_string(
const long long& value,
const std::string& fmt,
const std::locale& loc);
71 inline std::string
to_string(
const unsigned long long& value,
const std::string& fmt,
const std::locale& loc);
73 inline std::string
to_string(
const float& value,
const std::string& fmt,
const std::locale& loc);
75 inline std::string
to_string(
const double& value,
const std::string& fmt,
const std::locale& loc);
77 inline std::string
to_string(
const long double& value,
const std::string& fmt,
const std::locale& loc);
79 inline std::string
to_string(
const std::chrono::system_clock::time_point& value,
const std::string& fmt,
const std::locale& loc);
81 inline std::string
to_string(
const std::tm& value,
const std::string& fmt,
const std::locale& loc);
82 template<
typename type_t,
typename period_t = std::ratio<1>>
83 inline std::string
to_string(
const std::chrono::duration<type_t, period_t>& value,
const std::string& fmt,
const std::locale& loc);
84#if defined(__xtd__cpp_lib_char8_t)
86 inline std::string
to_string(
const xtd::char8& value,
const std::string& fmt,
const std::locale& loc);
89 inline std::string
to_string(
const xtd::char16& value,
const std::string& fmt,
const std::locale& loc);
91 inline std::string
to_string(
const xtd::char32& value,
const std::string& fmt,
const std::locale& loc);
93 inline std::string
to_string(
const xtd::wchar& value,
const std::string& fmt,
const std::locale& loc);
94#if defined(__xtd__cpp_lib_three_way_comparison)
96 inline std::string
to_string(
const std::partial_ordering& value,
const std::string& fmt,
const std::locale& loc);
98 inline std::string
to_string(
const std::strong_ordering& value,
const std::string& fmt,
const std::locale& loc);
100 inline std::string
to_string(
const std::weak_ordering& value,
const std::string& fmt,
const std::locale& loc);
102 template<
typename value_t>
103 inline std::string
to_string(
const value_t* value,
const std::string& fmt,
const std::locale& loc);
104 template<
typename value_t>
105 inline std::string
to_string(value_t*
const value,
const std::string& fmt,
const std::locale& loc);
106 template<
typename type_t>
107 inline std::string
to_string(
const std::shared_ptr<type_t>& value,
const std::string& fmt,
const std::locale& loc);
108 template<
typename type_t>
109 inline std::string
to_string(
const std::unique_ptr<type_t>& value,
const std::string& fmt,
const std::locale& loc);
111 inline std::string
to_string(
const std::any& value,
const std::string& fmt,
const std::locale& loc);
112 template<
typename types_t>
113 inline std::string
to_string(
const std::optional<types_t>& value,
const std::string& fmt,
const std::locale& loc);
115 inline std::string
to_string(
const std::nullopt_t& value,
const std::string& fmt,
const std::locale& loc);
116 template<
typename type1_t,
typename type2_t>
117 inline std::string
to_string(
const std::pair<type1_t, type2_t>& value,
const std::string& fmt,
const std::locale& loc);
118 template<
typename ... types_t>
119 inline std::string
to_string(
const std::tuple<types_t ...>& value,
const std::string& fmt,
const std::locale& loc);
120 template<
typename type_t,
size_t size>
121 inline std::string
to_string(
const std::array<type_t, size>& values,
const std::string& fmt,
const std::locale& loc);
122 template<
typename type_t,
typename allocator_t = std::allocator<type_t>>
123 inline std::string
to_string(
const std::deque<type_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
124 template<
typename type_t,
typename allocator_t = std::allocator<type_t>>
125 inline std::string
to_string(
const std::forward_list<type_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
126 template<
typename type_t>
127 inline std::string
to_string(
const std::initializer_list<type_t>& values,
const std::string& fmt,
const std::locale& loc);
128 template<
typename type_t,
typename allocator_t = std::allocator<type_t>>
129 inline std::string
to_string(
const std::list<type_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
130 template<
typename type_t>
131 inline std::string
to_string(
const std::valarray<type_t>& values,
const std::string& fmt,
const std::locale& loc);
132 template<
typename type_t,
typename allocator_t = std::allocator<type_t>>
133 inline std::string
to_string(
const std::vector<type_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
134 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>>>
135 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);
136 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>>>
137 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);
138 template<
typename key_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<key_t>>
139 inline std::string
to_string(
const std::multiset<key_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
140 template<
typename key_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<key_t>>
141 inline std::string
to_string(
const std::set<key_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
142 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>>>
143 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);
144 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>>>
145 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);
146 template<
typename key_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<key_t>>
147 inline std::string
to_string(
const std::unordered_multiset<key_t, compare_t, allocator_t>& values,
const std::string& fmt,
const std::locale& loc);
148 template<
typename key_t,
typename compare_t = std::less<key_t>,
typename allocator_t = std::allocator<key_t>>
149 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 value_t>
152 inline std::wstring
to_string(
const value_t& value,
const std::wstring& fmt,
const std::locale& loc);
154 inline std::wstring
to_string(
const bool& value,
const std::wstring& fmt,
const std::locale& loc);
156 inline std::wstring
to_string(
const xtd::sbyte& value,
const std::wstring& fmt,
const std::locale& loc);
158 inline std::wstring
to_string(
const char& value,
const std::wstring& fmt,
const std::locale& loc);
160 inline std::wstring
to_string(
const unsigned char& value,
const std::wstring& fmt,
const std::locale& loc);
162 inline std::wstring
to_string(
const short& value,
const std::wstring& fmt,
const std::locale& loc);
164 inline std::wstring
to_string(
const unsigned short& value,
const std::wstring& fmt,
const std::locale& loc);
166 inline std::wstring
to_string(
const int& value,
const std::wstring& fmt,
const std::locale& loc);
168 inline std::wstring
to_string(
const unsigned int& value,
const std::wstring& fmt,
const std::locale& loc);
170 inline std::wstring
to_string(
const long& value,
const std::wstring& fmt,
const std::locale& loc);
172 inline std::wstring
to_string(
const unsigned long& value,
const std::wstring& fmt,
const std::locale& loc);
174 inline std::wstring
to_string(
const long long& value,
const std::wstring& fmt,
const std::locale& loc);
176 inline std::wstring
to_string(
const unsigned long long& value,
const std::wstring& fmt,
const std::locale& loc);
178 inline std::wstring
to_string(
const float& value,
const std::wstring& fmt,
const std::locale& loc);
180 inline std::wstring
to_string(
const double& value,
const std::wstring& fmt,
const std::locale& loc);
182 inline std::wstring
to_string(
const long double& value,
const std::wstring& fmt,
const std::locale& loc);
184 inline std::wstring
to_string(
const std::chrono::system_clock::time_point& value,
const std::wstring& fmt,
const std::locale& loc);
186 inline std::wstring
to_string(
const std::tm& value,
const std::wstring& fmt,
const std::locale& loc);
188 template<
typename type_t,
typename period_t = std::ratio<1>>
189 inline std::wstring
to_string(
const std::chrono::duration<type_t, period_t>& value,
const std::wstring& fmt,
const std::locale& loc);
190#if defined(__xtd__cpp_lib_char8_t)
192 inline std::wstring
to_string(
const xtd::char8& value,
const std::wstring& fmt,
const std::locale& loc);
195 inline std::wstring
to_string(
const xtd::char16& value,
const std::wstring& fmt,
const std::locale& loc);
197 inline std::wstring
to_string(
const xtd::char32& value,
const std::wstring& fmt,
const std::locale& loc);
199 inline std::wstring
to_string(
const xtd::wchar& value,
const std::wstring& fmt,
const std::locale& loc);
201 template<
typename type_t,
typename string_t>
202 inline string_t
to_string(type_t value,
const std::map<type_t, string_t, std::greater<type_t>>& values) {
203 auto it = values.find(value);
204 if (it != values.end())
return it->second;
206 long long rest =
static_cast<long long>(value);
207 for (
auto item : values) {
208 if (
static_cast<long long>(item.first) != 0 && (rest &
static_cast<long long>(item.first)) ==
static_cast<long long>(item.first)) {
209 if (!result.empty()) result = string_t {
',',
' '} + result;
210 result = item.second + result;
211 rest -=
static_cast<long long>(item.first);
214 if (!result.empty())
return result;
215 return to_string(
static_cast<long long>(value), string_t {
'G'}, std::locale());
218 template<
typename type_t,
typename string_t>
219 inline string_t
to_string(type_t value,
const std::map<type_t, string_t>& values) {
220 std::map<type_t, string_t, std::greater<type_t>> descending_values;
221 for (
auto item : values) descending_values[item.first] = item.second;
222 return to_string(value, descending_values);
225 template<
typename type_t>
226 inline std::string
to_string(type_t value,
const std::initializer_list<std::pair<type_t, std::string>>& il) {
227 std::map<type_t, std::string, std::greater<type_t>> values;
228 for (
auto item : il) values[item.first] = item.second;
232 template<
typename type_t>
233 inline std::wstring
to_string(type_t value,
const std::initializer_list<std::pair<type_t, std::wstring>>& il) {
234 std::map<type_t, std::wstring, std::greater<type_t>> values;
235 for (
auto item : il) values[item.first] = item.second;
240template<
typename char_t>
241inline std::basic_string<char_t> __codepoint_to_string(
xtd::char32 codepoint) {
242 std::basic_string<char_t> result;
243 if (codepoint < 0x80)
244 result.push_back(
static_cast<char_t
>(codepoint));
245 else if (codepoint < 0x800) {
246 result.push_back(
static_cast<char_t
>((codepoint >> 6) | 0xc0));
247 result.push_back(
static_cast<char_t
>((codepoint & 0x3f) | 0x80));
248 }
else if (codepoint < 0x10000) {
249 result.push_back(
static_cast<char_t
>((codepoint >> 12) | 0xe0));
250 result.push_back(
static_cast<char_t
>(((codepoint >> 6) & 0x3f) | 0x80));
251 result.push_back(
static_cast<char_t
>((codepoint & 0x3f) | 0x80));
253 result.push_back(
static_cast<char_t
>((codepoint >> 18) | 0xf0));
254 result.push_back(
static_cast<char_t
>(((codepoint >> 12) & 0x3f) | 0x80));
255 result.push_back(
static_cast<char_t
>(((codepoint >> 6) & 0x3f) | 0x80));
256 result.push_back(
static_cast<char_t
>((codepoint & 0x3f) | 0x80));
261template<
typename char_t>
262inline std::basic_string<char_t> __to_string(
char codepoint) {
263 return __codepoint_to_string<char_t>(codepoint);
266template<
typename char_t>
267inline std::basic_string<char_t> __to_string(
xtd::char32 codepoint) {
268 return __codepoint_to_string<char_t>(codepoint);
271template<
typename char_t>
272inline std::basic_string<char_t> __to_string(
xtd::char16 codepoint) {
273 return __codepoint_to_string<char_t>(codepoint);
276#if defined(__xtd__cpp_lib_char8_t)
277template<
typename char_t>
278inline std::basic_string<char_t> __to_string(
xtd::char8 codepoint) {
279 return __codepoint_to_string<char_t>(codepoint);
283template<
typename char_t>
284inline std::basic_string<char_t> __to_string(
xtd::wchar codepoint) {
285 return __codepoint_to_string<char_t>(codepoint);
288template<
typename char_t>
289inline std::basic_string<char_t> __to_string(
const std::basic_string<char_t>& str) {
290 std::basic_string<char_t> result;
291 std::for_each(str.begin(), str.end(), [&](
auto codepoint) {result += __to_string<char_t>(codepoint);});
295template<
typename char_t,
typename arg_t>
296inline std::basic_string<char_t> __to_string(
const std::basic_string<arg_t>& str) {
297 std::basic_string<char_t> result;
298 for (
auto codepoint : str)
299 result += __to_string<char_t>(codepoint);
303template<
typename char_t,
typename arg_t>
304inline std::basic_string<char_t> __to_string(
const arg_t* str) {
305 std::basic_string<char_t> result;
306 for (
auto codepoint : std::basic_string<arg_t>(str))
307 result += __to_string<char_t>(codepoint);
311template<
typename char_t,
typename type_t,
typename period_t = std::ratio<1>>
312std::basic_ostream<char_t>& operator <<(std::basic_ostream<char_t>& os,
const std::chrono::duration<type_t, period_t>& value) {
313 return os <<
xtd::to_string(value, std::basic_string<char_t> {
'G'}, std::locale());
316#if defined(__xtd__cpp_lib_char8_t)
317std::ostream& operator <<(std::ostream& os,
const xtd::char8* str);
319std::ostream& operator <<(std::ostream& os,
const xtd::char16* str);
320std::ostream& operator <<(std::ostream& os,
const xtd::char32* str);
321std::ostream& operator <<(std::ostream& os,
const xtd::wchar* str);
323template<
typename enum_t>
324std::string __enum_to_string(enum_t value)
noexcept;
326std::string __object_to_string(
const xtd::object& value)
noexcept;
328template <
typename char_t,
typename type_t,
typename bool_t>
329struct __enum_ostream__ {};
331template <
typename char_t,
typename type_t>
332struct __enum_ostream__<char_t, type_t, std::true_type> {
333 std::basic_ostream<char_t>& to_stream(std::basic_ostream<char_t>& os,
const type_t& value)
noexcept {
334 return os << __enum_to_string(value);
338template <
typename char_t,
typename type_t>
339struct __enum_ostream__<char_t, type_t, std::false_type> {
340 std::basic_ostream<char_t>& to_stream(std::basic_ostream<char_t>& os,
const type_t& value)
noexcept {
342 return os <<
xtd::to_string(value, std::basic_string<char_t> {}, std::locale {});
346template <
typename char_t,
typename type_t,
typename bool_t>
347struct __enum_or_polymorphic_ostream__ {};
349template <
typename char_t,
typename type_t>
350struct __enum_or_polymorphic_ostream__<char_t, type_t, std::true_type> {
351 std::basic_ostream<char_t>& to_stream(std::basic_ostream<char_t>& os,
const type_t& value)
noexcept {
352 if (
dynamic_cast<const xtd::iformatable*
>(&value))
return os << __iformatable_to_string(dynamic_cast<const xtd::iformatable&>(value));
353 if (
dynamic_cast<const xtd::object*
>(&value))
return os << __object_to_string(
dynamic_cast<const xtd::object&
>(value));
358template <
typename char_t,
typename type_t>
359struct __enum_or_polymorphic_ostream__<char_t, type_t, std::false_type> {
360 std::basic_ostream<char_t>& to_stream(std::basic_ostream<char_t>& os,
const type_t& value)
noexcept {
361 __enum_ostream__<char, type_t, typename std::is_enum<type_t>::type>().to_stream(os, value);
366template<
typename value_t>
367std::string __format_stringer_to_std_string(
const value_t& value) {
368 std::basic_stringstream<char> ss;
370 __enum_or_polymorphic_ostream__<char, value_t, typename std::is_polymorphic<value_t>::type>().to_stream(ss, value);
374std::string __format_stringer_to_std_string(
const char& c);
375#if defined(__xtd__cpp_lib_char8_t)
376std::string __format_stringer_to_std_string(
const xtd::char8& c);
378std::string __format_stringer_to_std_string(
const xtd::char16& c);
379std::string __format_stringer_to_std_string(
const xtd::char32& c);
380std::string __format_stringer_to_std_string(
const xtd::wchar& c);
381std::string __format_stringer_to_std_string(
const char* str);
382#if defined(__xtd__cpp_lib_char8_t)
383std::string __format_stringer_to_std_string(
const xtd::char8* str);
385std::string __format_stringer_to_std_string(
const xtd::char16* str);
386std::string __format_stringer_to_std_string(
const xtd::char32* str);
387std::string __format_stringer_to_std_string(
const xtd::wchar* str);
388std::string __format_stringer_to_std_string(
const std::string& str);
389std::string __format_stringer_to_std_string(
const xtd::string& str);
390#if defined(__xtd__cpp_lib_char8_t)
391std::string __format_stringer_to_std_string(
const std::u8string& str);
393std::string __format_stringer_to_std_string(
const std::u16string& str);
394std::string __format_stringer_to_std_string(
const std::u32string& str);
395std::string __format_stringer_to_std_string(
const std::wstring& str);
397template<
typename char_t,
typename value_t>
398inline std::basic_string<char_t> __format_stringer(value_t value) {
399 std::basic_stringstream<char_t> ss;
400 ss << __format_stringer_to_std_string(value).c_str();
404template<
typename char_t,
typename value_t>
405inline std::basic_string<char_t> __format_stringer(
const bool& value) {
406 std::basic_stringstream<char_t> ss;
407 ss << std::boolalpha << value;
411template<
typename char_t,
typename value_t, xtd::
int32 len>
412inline std::basic_string<char_t> __format_stringer(
const char*& value) {
413 std::basic_stringstream<char_t> ss;
414 ss << __to_string<char_t>(value);
418template<
typename char_t,
typename value_t, xtd::
int32 len>
419inline std::basic_string<char_t> __format_stringer(
const char*
const& value) {
420 std::basic_stringstream<char_t> ss;
421 ss << __to_string<char_t>(value);
425#if defined(__xtd__cpp_lib_char8_t)
426template<
typename char_t,
typename value_t>
427inline std::basic_string<char_t> __format_stringer(
const xtd::char8*& value) {
428 auto s = std::u8string(value);
429 std::basic_stringstream<char_t> ss;
430 ss << std::basic_string<char_t>(
s.begin(),
s.end());
434template<
typename char_t,
typename value_t>
435inline std::basic_string<char_t> __format_stringer(
const xtd::char8*
const& value) {
436 auto s = std::u8string(value);
437 std::basic_stringstream<char_t> ss;
438 ss << std::basic_string<char_t>(
s.begin(),
s.end());
443template<
typename char_t,
typename value_t>
444inline std::basic_string<char_t> __format_stringer(
const xtd::char16*& value) {
445 std::basic_stringstream<char_t> ss;
446 ss << __to_string<char_t>(value);
450template<
typename char_t,
typename value_t>
451inline std::basic_string<char_t> __format_stringer(
const xtd::char16*
const& value) {
452 std::basic_stringstream<char_t> ss;
453 ss << __to_string<char_t>(value);
457template<
typename char_t,
typename value_t>
458inline std::basic_string<char_t> __format_stringer(
const xtd::char32*& value) {
459 std::basic_stringstream<char_t> ss;
460 ss << __to_string<char_t>(value);
464template<
typename char_t,
typename value_t>
465inline std::basic_string<char_t> __format_stringer(
const xtd::char32*
const& value) {
466 std::basic_stringstream<char_t> ss;
467 ss << __to_string<char_t>(value);
471template<
typename char_t,
typename value_t>
472inline std::basic_string<char_t> __format_stringer(
const xtd::wchar*& value) {
473 std::basic_stringstream<char_t> ss;
474 ss << __to_string<char_t>(value);
478template<
typename char_t,
typename value_t>
479inline std::basic_string<char_t> __format_stringer(
const xtd::wchar*
const& value) {
480 std::basic_stringstream<char_t> ss;
481 ss << __to_string<char_t>(value);
485#if defined(__xtd__cpp_lib_char8_t)
487inline std::string __format_stringer<char, std::u8string&>(std::u8string& value) {
488 std::basic_stringstream<char> ss;
489 ss << std::string(value.begin(), value.end());
495inline std::string __format_stringer<char, const std::u16string&>(
const std::u16string& value) {
496 std::basic_stringstream<char> ss;
497 ss << __to_string<char>(value);
502inline std::string __format_stringer<char, const std::u32string&>(
const std::u32string& value) {
503 std::basic_stringstream<char> ss;
504 ss << __to_string<char>(value);
509inline std::string __format_stringer<char, const std::wstring&>(
const std::wstring& value) {
510 std::basic_stringstream<char> ss;
511 ss << __to_string<char>(value);
516inline std::string __format_stringer<char, bool&>(
bool& value) {
521inline std::string __format_stringer<char, xtd::sbyte&>(
xtd::sbyte& value) {
526inline std::string __format_stringer<char, const unsigned char&>(
const unsigned char& value) {
531inline std::string __format_stringer<char, unsigned char&>(
unsigned char& value) {
536inline std::string __format_stringer<char, short&>(
short& value) {
541inline std::string __format_stringer<char, unsigned short&>(
unsigned short& value) {
546inline std::string __format_stringer<char, int&>(
int& value) {
551inline std::string __format_stringer<char, unsigned int&>(
unsigned int& value) {
556inline std::string __format_stringer<char, long&>(
long& value) {
561inline std::string __format_stringer<char, unsigned long&>(
unsigned long& value) {
566inline std::string __format_stringer<char, long long&>(
long long& value) {
571inline std::string __format_stringer<char, unsigned long long&>(
unsigned long long& value) {
576inline std::string __format_stringer<char, float&>(
float& value) {
581inline std::string __format_stringer<char, double&>(
double& value) {
586inline std::string __format_stringer<char, long double&>(
long double& value) {
591inline std::string __format_stringer<char, std::chrono::system_clock::time_point&> (std::chrono::system_clock::time_point& value) {
596inline std::string __format_stringer<char, std::tm&> (tm& value) {
601inline std::string __format_stringer<char, xtd::wchar&>(
xtd::wchar& value) {
605#if defined(__xtd__cpp_lib_char8_t)
607inline std::string __format_stringer<char, xtd::char8&>(
xtd::char8& value) {
613inline std::string __format_stringer<char, xtd::char16&>(
xtd::char16& value) {
618inline std::string __format_stringer<char, xtd::char32&>(
xtd::char32& value) {
622#if defined(__xtd__cpp_lib_char8_t)
624inline std::wstring __format_stringer<xtd::wchar, std::u8string&>(std::u8string& value) {
625 std::basic_stringstream<xtd::wchar> ss;
626 ss << std::wstring(value.begin(), value.end());
632inline std::wstring __format_stringer<xtd::wchar, const std::u16string&>(
const std::u16string& value) {
633 std::basic_stringstream<xtd::wchar> ss;
634 ss << __to_string<xtd::wchar>(value);
639inline std::wstring __format_stringer<xtd::wchar, const std::u32string&>(
const std::u32string& value) {
640 std::basic_stringstream<xtd::wchar> ss;
641 ss << __to_string<xtd::wchar>(value);
646inline std::wstring __format_stringer<xtd::wchar, const std::string&>(
const std::string& value) {
647 std::basic_stringstream<xtd::wchar> ss;
648 ss << __to_string<xtd::wchar>(value);
653inline std::wstring __format_stringer<xtd::wchar, bool&>(
bool& value) {
658inline std::wstring __format_stringer<xtd::wchar, xtd::sbyte&>(
xtd::sbyte& value) {
663inline std::wstring __format_stringer<xtd::wchar, char&>(
char& value) {
668inline std::wstring __format_stringer<xtd::wchar, unsigned char&>(
unsigned char& value) {
673inline std::wstring __format_stringer<xtd::wchar, short&>(
short& value) {
678inline std::wstring __format_stringer<xtd::wchar, unsigned short&>(
unsigned short& value) {
683inline std::wstring __format_stringer<xtd::wchar, int&>(
int& value) {
688inline std::wstring __format_stringer<xtd::wchar, unsigned int&>(
unsigned int& value) {
693inline std::wstring __format_stringer<xtd::wchar, long&>(
long& value) {
698inline std::wstring __format_stringer<xtd::wchar, unsigned long&>(
unsigned long& value) {
703inline std::wstring __format_stringer<xtd::wchar, long long&>(
long long& value) {
708inline std::wstring __format_stringer<xtd::wchar, unsigned long long&>(
unsigned long long& value) {
713inline std::wstring __format_stringer<xtd::wchar, float&>(
float& value) {
718inline std::wstring __format_stringer<xtd::wchar, double&>(
double& value) {
723inline std::wstring __format_stringer<xtd::wchar, long double&>(
long double& value) {
728inline std::wstring __format_stringer<xtd::wchar, std::chrono::system_clock::time_point&> (std::chrono::system_clock::time_point& value) {
733inline 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
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