7 #define __XTD_CORE_INTERNAL__
8 #include "internal/__binary_formatter.h"
9 #include "internal/__boolean_formatter.h"
10 #include "internal/__character_formatter.h"
11 #include "internal/__currency_formatter.h"
12 #include "internal/__date_time_formatter.h"
13 #include "internal/__duration_formatter.h"
14 #include "internal/__enum_formatter.h"
15 #include "internal/__fixed_point_formatter.h"
16 #include "internal/__natural_formatter.h"
17 #include "internal/__numeric_formatter.h"
18 #include "internal/__string_formatter.h"
19 #undef __XTD_CORE_INTERNAL__
36 template<
typename value_t>
37 inline std::string
to_string(
const value_t& value,
const std::string& fmt,
const std::locale& loc) {
return __to_string_enum(value, fmt, loc, std::is_enum<value_t>());}
50 inline std::string
to_string(
const bool& value,
const std::string& fmt,
const std::locale& loc) {
return __boolean_formatter(fmt, value, loc);}
63 inline std::string
to_string(
const int8_t& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
76 inline std::string
to_string(
const char& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
89 inline std::string
to_string(
const unsigned char& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
102 inline std::string
to_string(
const short& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
115 inline std::string
to_string(
const unsigned short& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
128 inline std::string
to_string(
const int& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
141 inline std::string
to_string(
const unsigned int& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
154 inline std::string
to_string(
const long& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
167 inline std::string
to_string(
const unsigned long& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
180 inline std::string
to_string(
const long long& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
193 inline std::string
to_string(
const unsigned long long& value,
const std::string& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
206 inline std::string
to_string(
const float& value,
const std::string& fmt,
const std::locale& loc) {
return __fixed_point_formatter(fmt, value, loc);}
219 inline std::string
to_string(
const double& value,
const std::string& fmt,
const std::locale& loc) {
return __fixed_point_formatter(fmt, value, loc);}
232 inline std::string
to_string(
const long double& value,
const std::string& fmt,
const std::locale& loc) {
return __fixed_point_formatter(fmt, value, loc);}
245 inline std::string
to_string(
const std::chrono::system_clock::time_point& value,
const std::string& fmt,
const std::locale& loc) {
return __date_time_formatter(fmt, std::chrono::system_clock::to_time_t(value), loc);}
258 inline std::string
to_string(
const std::tm& value,
const std::string& fmt,
const std::locale& loc) {
return __date_time_formatter(fmt, value, loc);}
270 template<
typename type_t,
typename Period>
271 inline std::string
to_string(
const std::chrono::duration<type_t, Period>& value,
const std::string& fmt,
const std::locale& loc) {
return __duration_formatter(fmt, value, loc);}
284 inline std::string
to_string(
const char8_t& value,
const std::string& fmt,
const std::locale& loc) {
return __character_formatter(fmt, value, loc);}
297 inline std::string
to_string(
const char16_t& value,
const std::string& fmt,
const std::locale& loc) {
return __character_formatter(fmt, value, loc);}
310 inline std::string
to_string(
const char32_t& value,
const std::string& fmt,
const std::locale& loc) {
return __character_formatter(fmt, value, loc);}
323 inline std::string
to_string(
const wchar_t& value,
const std::string& fmt,
const std::locale& loc) {
return __character_formatter(fmt, value, loc);}
326 std::string
to_string(
const char* value,
const std::string& fmt,
const std::locale& loc);
327 std::string
to_string(
const char8_t* value,
const std::string& fmt,
const std::locale& loc);
328 std::string
to_string(
const char16_t* value,
const std::string& fmt,
const std::locale& loc);
329 std::string
to_string(
const char32_t* value,
const std::string& fmt,
const std::locale& loc);
330 std::string
to_string(
const wchar_t* value,
const std::string& fmt,
const std::locale& loc);
331 std::string
to_string(
const std::string& value,
const std::string& fmt,
const std::locale& loc);
333 std::string
to_string(
const std::u8string& value,
const std::string& fmt,
const std::locale& loc);
334 std::string
to_string(
const std::u16string& value,
const std::string& fmt,
const std::locale& loc);
335 std::string
to_string(
const std::u32string& value,
const std::string& fmt,
const std::locale& loc);
336 std::string
to_string(
const std::wstring& value,
const std::string& fmt,
const std::locale& loc);
348 template<
typename value_t>
349 inline std::string
to_string(
const value_t& value,
const std::string& fmt) {
return to_string(value, fmt, std::locale());}
352 inline std::string
to_string(
const char* value,
const std::string& fmt) {
return to_string(value, fmt, std::locale());}
365 template<
typename value_t>
366 inline std::wstring
to_string(
const value_t& value,
const std::wstring& fmt,
const std::locale& loc) {
return __to_string_enum(value, fmt, loc, std::is_enum<value_t>());}
379 inline std::wstring
to_string(
const bool& value,
const std::wstring& fmt,
const std::locale& loc) {
return __boolean_formatter(fmt, value, loc);}
392 inline std::wstring
to_string(
const int8_t& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
405 inline std::wstring
to_string(
const char& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
418 inline std::wstring
to_string(
const unsigned char& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
431 inline std::wstring
to_string(
const short& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
444 inline std::wstring
to_string(
const unsigned short& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
457 inline std::wstring
to_string(
const int& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
470 inline std::wstring
to_string(
const unsigned int& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
483 inline std::wstring
to_string(
const long& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
496 inline std::wstring
to_string(
const unsigned long& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
509 inline std::wstring
to_string(
const long long& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
522 inline std::wstring
to_string(
const unsigned long long& value,
const std::wstring& fmt,
const std::locale& loc) {
return __numeric_formatter(fmt, value, loc);}
535 inline std::wstring
to_string(
const float& value,
const std::wstring& fmt,
const std::locale& loc) {
return __fixed_point_formatter(fmt, value, loc);}
548 inline std::wstring
to_string(
const double& value,
const std::wstring& fmt,
const std::locale& loc) {
return __fixed_point_formatter(fmt, value, loc);}
561 inline std::wstring
to_string(
const long double& value,
const std::wstring& fmt,
const std::locale& loc) {
return __fixed_point_formatter(fmt, value, loc);}
574 inline std::wstring
to_string(
const std::chrono::system_clock::time_point& value,
const std::wstring& fmt,
const std::locale& loc) {
return __date_time_formatter(fmt, std::chrono::system_clock::to_time_t(value), loc);}
587 inline std::wstring
to_string(
const std::tm& value,
const std::wstring& fmt,
const std::locale& loc) {
return __date_time_formatter(fmt, value, loc);}
599 template<
typename type_t,
typename Period>
600 inline std::wstring
to_string(
const std::chrono::duration<type_t, Period>& value,
const std::wstring& fmt,
const std::locale& loc) {
return __duration_formatter(fmt, value, loc);}
613 inline std::wstring
to_string(
const std::wstring& value,
const std::wstring& fmt,
const std::locale& loc) {
return __string_formatter(fmt, value, loc);}
626 inline std::wstring
to_string(
const char8_t& value,
const std::wstring& fmt,
const std::locale& loc) {
return __character_formatter(fmt, value, loc);}
639 inline std::wstring
to_string(
const char16_t& value,
const std::wstring& fmt,
const std::locale& loc) {
return __character_formatter(fmt, value, loc);}
652 inline std::wstring
to_string(
const char32_t& value,
const std::wstring& fmt,
const std::locale& loc) {
return __character_formatter(fmt, value, loc);}
665 inline std::wstring
to_string(
const wchar_t& value,
const std::wstring& fmt,
const std::locale& loc) {
return __character_formatter(fmt, value, loc);}
668 inline std::wstring
to_string(
const wchar_t* value,
const std::wstring& fmt,
const std::locale& loc) {
return __string_formatter(fmt, value, loc);}
680 template<
typename value_t>
681 inline std::wstring
to_string(
const value_t& value,
const std::wstring& fmt) {
return to_string(value, fmt, std::locale());}
684 inline std::wstring
to_string(
const wchar_t* value,
const std::wstring& fmt) {
return to_string(value, fmt, std::locale());}
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
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.h:37
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd fundamental types.