xtd 1.0.0
Loading...
Searching...
No Matches
to_string.hpp
Go to the documentation of this file.
1
4#pragma once
6#define __XTD_CORE_INTERNAL__
19#undef __XTD_CORE_INTERNAL__
20#define __XTD_STD_INTERNAL__
22#undef __XTD_STD_INTERNAL__
26#include "types.hpp"
27#include "string.hpp"
28
30namespace xtd {
41 template<typename value_t>
42 inline auto to_string(const value_t& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
43
54 template<>
55 inline auto to_string(const bool& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
56
67 template<>
68 inline auto to_string(const sbyte& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
69
80 template<>
81 inline auto to_string(const char& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
82
93 template<>
94 inline auto to_string(const unsigned char& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
95
106 template<>
107 inline auto to_string(const short& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
108
119 template<>
120 inline auto to_string(const unsigned short& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
121
132 template<>
133 inline auto to_string(const int& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
134
145 template<>
146 inline auto to_string(const unsigned int& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
147
158 template<>
159 inline auto to_string(const long& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
160
171 template<>
172 inline auto to_string(const unsigned long& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
173
184 template<>
185 inline auto to_string(const long long& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
186
197 template<>
198 inline auto to_string(const unsigned long long& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
199
210 template<>
211 inline auto to_string(const float& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
212
223 template<>
224 inline auto to_string(const double& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
225
236 template<>
237 inline auto to_string(const long double& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
238
249 template<>
250 inline auto to_string(const std::chrono::system_clock::time_point& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
251
262 template<>
263 inline auto to_string(const std::tm& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
264
275 template<typename type_t, typename period_t>
276 inline auto to_string(const std::chrono::duration<type_t, period_t>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
277
288 template<>
289 inline auto to_string(const char8& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
290
301 template<>
302 inline auto to_string(const char16& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
303
314 template<>
315 inline auto to_string(const char32& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
316
327 template<>
328 inline auto to_string(const wchar& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
329
331 auto to_string(const char* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
332 auto to_string(const char8* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
333 auto to_string(const char16* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
334 auto to_string(const char32* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
335 auto to_string(const wchar* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
336 auto to_string(const std::string& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
337 auto to_string(const xtd::string& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
338 auto to_string(const std::u8string& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
339 auto to_string(const std::u16string& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
340 auto to_string(const std::u32string& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
341 auto to_string(const std::wstring& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
343
353 template<typename value_t>
354 inline auto to_string(const value_t& value, const xtd::string& fmt) -> xtd::string;
355
357 inline auto to_string(const char* value, const xtd::string& fmt) -> xtd::string;
358
359 template<>
360 inline auto to_string(const std::partial_ordering& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
361
362 template<>
363 inline auto to_string(const std::strong_ordering& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
364
365 template<>
366 inline auto to_string(const std::weak_ordering& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
367
368 template<typename value_t>
369 inline auto to_string(const value_t* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
370
371 template<typename value_t>
372 inline auto to_string(value_t* const value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
373
374 template<typename type_t>
375 inline auto to_string(const std::shared_ptr<type_t>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
376
377 template<typename type_t>
378 inline auto to_string(const std::unique_ptr<type_t>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
379
380 template<>
381 inline auto to_string(const xtd::any& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
382
383 template<typename type_t>
384 inline auto to_string(const std::optional<type_t>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
385
386 template<>
387 inline auto to_string(const std::nullopt_t& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
388
389 template<>
390 inline auto to_string(const std::nullptr_t&, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
391
392 template<typename type1_t, typename type2_t>
393 inline auto to_string(const std::pair<type1_t, type2_t>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
394
395 template<typename type_t, unsigned n_t, unsigned last_t>
396 struct __xtd_tuple_stringer {
397 static auto to_string(const std::string& str, const type_t& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
398 };
399
400 template<typename type_t, unsigned n_t>
401 struct __xtd_tuple_stringer<type_t, n_t, n_t> {
402 static auto to_string(const std::string& str, const type_t& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
403 };
404
405 template<typename ...types_t>
406 inline auto to_string(const std::tuple<types_t ...>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
407
408 template<typename type_t, xtd::usize size>
409 inline auto to_string(const std::array<type_t, size>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
410
411 template<xtd::usize size>
412 inline auto to_string(const std::bitset<size>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
413
414 template<typename type_t, typename allocator_t>
415 inline auto to_string(const std::deque<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
416
417 template<typename type_t, typename allocator_t>
418 inline auto to_string(const std::forward_list<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
419
420 template<typename type_t>
421 inline auto to_string(const std::initializer_list<type_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
422
423 template<typename type_t, typename allocator_t>
424 inline auto to_string(const std::list<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
425
426 template<typename type_t, typename container_t>
427 inline auto to_string(const std::queue<type_t, container_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
428
429 template<typename type_t, typename container_t>
430 inline auto to_string(const std::priority_queue<type_t, container_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
431
432 template<typename type_t, typename container_t>
433 inline auto to_string(const std::stack<type_t, container_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
434
435 template<typename type_t>
436 inline auto to_string(const std::valarray<type_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
437
438 template<typename type_t, typename allocator_t>
439 inline auto to_string(const std::vector<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
440
441 template<typename key_t, typename value_t, typename compare_t, typename allocator_t>
442 inline auto to_string(const std::map<key_t, value_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
443
444 template<typename key_t, typename value_t, typename compare_t, typename allocator_t>
445 inline auto to_string(const std::multimap<key_t, value_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
446
447 template<typename key_t, typename compare_t, typename allocator_t>
448 inline auto to_string(const std::multiset<key_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
449
450 template<typename key_t, typename compare_t, typename allocator_t>
451 inline auto to_string(const std::set<key_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
452
453 template<typename key_t, typename value_t, typename compare_t, typename allocator_t>
454 inline auto to_string(const std::unordered_map<key_t, value_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
455
456 template<typename key_t, typename value_t, typename compare_t, typename allocator_t>
457 inline auto to_string(const std::unordered_multimap<key_t, value_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
458
459 template<typename key_t, typename compare_t, typename allocator_t>
460 inline auto to_string(const std::unordered_multiset<key_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
461
462 template<typename key_t, typename compare_t, typename allocator_t>
463 inline auto to_string(const std::unordered_set<key_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
464
465 template<typename ...args_t>
466 inline auto to_string(const std::variant<args_t...>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
467
468 template<typename type_t>
469 inline auto to_string(type_t value, const std::initializer_list<std::pair<type_t, xtd::string>>& il) -> xtd::string;
470
471 auto to_string(const std::locale& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
472
473 #if defined(__xtd__cpp_lib_ranges)
474 //template <std::ranges::range range_t>
475 //inline auto to_string(const range_t& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
476
477 //template <std::ranges::range range_t>
478 //inline auto to_string(const range_t& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
479 #endif
480
481 template<typename type_t>
482 inline auto to_string(const xtd::collections::generic::ienumerable<type_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
483
484 template<typename type_t>
485 inline auto to_string(const xtd::collections::generic::helpers::raw_array<type_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
486
487 template<typename type_t, typename string_t>
488 inline auto to_string(type_t value, const std::map<type_t, string_t, std::greater<type_t>>& values) -> string_t;
489
490 template<typename type_t, typename string_t>
491 inline auto to_string(type_t value, const std::map<type_t, string_t>& values) -> string_t;
493}
494
495#define __XTD_TO_STRING_INTERNAL__
496#include "to_string_.hpp"
497#undef __XTD_TO_STRING_INTERNAL__
Contains generic stream output methods.
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:26
std::int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.hpp:23
wchar_t wchar
Represents a wide character.
Definition wchar.hpp:24
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:23
std::any any
Represents the any alias on std::any.
Definition any.hpp:24
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
auto to_string() const noexcept -> xtd::string override
Returns the string representation of this xtd::read_only_span <type_t> object.
Definition read_only_span.hpp:342
Contains xtd::register_any_stringer and xtd::unregister_any_stringer method.
Contains xtd::string alias.
Contains xtd::to_string methods.
Contains xtd fundamental types.