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__
22#include "iterable.hpp"
24#include "textual.hpp"
25#include "types.hpp"
26#include "string.hpp"
27#include <filesystem>
28
30namespace xtd {
31 /*
42 template<typename value_t>
43 requires (requires (const xtd::raw_type<value_t>& value, const xtd::string& fmt) {{value.to_string(fmt)} -> xtd::textual;})
44 inline auto to_string(const value_t& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
45
56 template<typename value_t>
57 requires (!requires (const xtd::raw_type<value_t>& value, const xtd::string& fmt) {{value.to_string(fmt)} -> xtd::textual;} && requires (const xtd::raw_type<value_t>& value) {{value.to_string()} -> xtd::textual;})
58 inline auto to_string(const value_t& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
59 */
60
71 template<typename value_t>
72 inline auto to_string(const value_t& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
73
84 template<>
85 inline auto to_string(const bool& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
86
97 template<>
98 inline auto to_string(const sbyte& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
99
110 template<>
111 inline auto to_string(const char& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
112
123 template<>
124 inline auto to_string(const unsigned char& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
125
136 template<>
137 inline auto to_string(const short& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
138
149 template<>
150 inline auto to_string(const unsigned short& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
151
162 template<>
163 inline auto to_string(const int& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
164
175 template<>
176 inline auto to_string(const unsigned int& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
177
188 template<>
189 inline auto to_string(const long& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
190
201 template<>
202 inline auto to_string(const unsigned long& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
203
214 template<>
215 inline auto to_string(const long long& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
216
227 template<>
228 inline auto to_string(const unsigned long long& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
229
240 template<>
241 inline auto to_string(const float& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
242
253 template<>
254 inline auto to_string(const double& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
255
266 template<>
267 inline auto to_string(const long double& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
268
279 template<>
280 inline auto to_string(const std::chrono::system_clock::time_point& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
281
292 template<>
293 inline auto to_string(const std::tm& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
294
305 template<typename type_t, typename period_t>
306 inline auto to_string(const std::chrono::duration<type_t, period_t>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
307
318 template<>
319 inline auto to_string(const char8& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
320
331 template<>
332 inline auto to_string(const char16& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
333
344 template<>
345 inline auto to_string(const char32& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
346
357 template<>
358 inline auto to_string(const wchar& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
359
361 auto to_string(const char* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
362 auto to_string(const char8* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
363 auto to_string(const char16* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
364 auto to_string(const char32* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
365 auto to_string(const wchar* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
366 auto to_string(const std::string& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
367 auto to_string(const xtd::string& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
368 auto to_string(const std::u8string& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
369 auto to_string(const std::u16string& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
370 auto to_string(const std::u32string& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
371 auto to_string(const std::wstring& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
373
383 template<typename value_t>
384 inline auto to_string(const value_t& value, const xtd::string& fmt) -> xtd::string;
385
387 inline auto to_string(const char* value, const xtd::string& fmt) -> xtd::string;
388
389 template<>
390 inline auto to_string(const std::partial_ordering& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
391
392 template<>
393 inline auto to_string(const std::strong_ordering& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
394
395 template<>
396 inline auto to_string(const std::weak_ordering& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
397
398 template<typename value_t>
399 inline auto to_string(const value_t* value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
400
401 template<typename value_t>
402 inline auto to_string(value_t* const value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
403
404 template<typename type_t>
405 inline auto to_string(const std::shared_ptr<type_t>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
406
407 template<typename type_t>
408 inline auto to_string(const std::unique_ptr<type_t>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
409
410 template<>
411 inline auto to_string(const xtd::any& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
412
413 template<typename type_t>
414 inline auto to_string(const std::optional<type_t>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
415
416 template<>
417 inline auto to_string(const std::nullopt_t& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
418
419 template<>
420 inline auto to_string(const std::nullptr_t&, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
421
422 template<typename type1_t, typename type2_t>
423 inline auto to_string(const std::pair<type1_t, type2_t>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
424
425 template<typename type_t, unsigned n_t, unsigned last_t>
426 struct __xtd_tuple_stringer {
427 static auto to_string(const std::string& str, const type_t& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
428 };
429
430 template<typename type_t, unsigned n_t>
431 struct __xtd_tuple_stringer<type_t, n_t, n_t> {
432 static auto to_string(const std::string& str, const type_t& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
433 };
434
435 template<typename ...types_t>
436 inline auto to_string(const std::tuple<types_t ...>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
437
438 template<typename type_t, xtd::usize size>
439 inline auto to_string(const std::array<type_t, size>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
440
441 template<xtd::usize size>
442 inline auto to_string(const std::bitset<size>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
443
444 template<typename type_t, typename allocator_t>
445 inline auto to_string(const std::deque<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
446
447 template<typename type_t, typename allocator_t>
448 inline auto to_string(const std::forward_list<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
449
450 template<typename type_t>
451 inline auto to_string(const std::initializer_list<type_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
452
453 template<typename type_t, typename allocator_t>
454 inline auto to_string(const std::list<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
455
456 template<typename type_t, typename container_t>
457 inline auto to_string(const std::queue<type_t, container_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
458
459 template<typename type_t, typename container_t>
460 inline auto to_string(const std::priority_queue<type_t, container_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
461
462 template<typename type_t, typename container_t>
463 inline auto to_string(const std::stack<type_t, container_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
464
465 template<typename type_t>
466 inline auto to_string(const std::valarray<type_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
467
468 template<typename type_t, typename allocator_t>
469 inline auto to_string(const std::vector<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
470
471 template<typename key_t, typename value_t, typename compare_t, typename allocator_t>
472 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;
473
474 template<typename key_t, typename value_t, typename compare_t, typename allocator_t>
475 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;
476
477 template<typename key_t, typename compare_t, typename allocator_t>
478 inline auto to_string(const std::multiset<key_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
479
480 template<typename key_t, typename compare_t, typename allocator_t>
481 inline auto to_string(const std::set<key_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
482
483 template<typename key_t, typename value_t, typename compare_t, typename allocator_t>
484 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;
485
486 template<typename key_t, typename value_t, typename compare_t, typename allocator_t>
487 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;
488
489 template<typename key_t, typename compare_t, typename allocator_t>
490 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;
491
492 template<typename key_t, typename compare_t, typename allocator_t>
493 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;
494
495 template<typename ...args_t>
496 inline auto to_string(const std::variant<args_t...>& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
497
498 template<typename type_t>
499 inline auto to_string(type_t value, const std::initializer_list<std::pair<type_t, xtd::string>>& il) -> xtd::string;
500
501 auto to_string(const std::locale& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
502
503 template<>
504 inline auto to_string(const std::filesystem::path& value, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
505
506 template<typename type_t>
507 inline auto to_string(const xtd::collections::generic::ienumerable<type_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
508
509 template<typename type_t>
510 inline auto to_string(const xtd::collections::generic::helpers::raw_array<type_t>& values, const xtd::string& fmt, const std::locale& loc) -> xtd::string;
511
512 template<typename type_t, typename string_t>
513 inline auto to_string(type_t value, const std::map<type_t, string_t, std::greater<type_t>>& values) -> string_t;
514
515 template<typename type_t, typename string_t>
516 inline auto to_string(type_t value, const std::map<type_t, string_t>& values) -> string_t;
518}
519
520#define __XTD_TO_STRING_INTERNAL__
521#include "to_string_.hpp"
522#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
Contains xtd::iterable concept.
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:356
Contains xtd::register_any_stringer and xtd::unregister_any_stringer method.
Contains xtd::string alias.
Contains xtd::textual concept.
Contains xtd::to_string methods.
Contains xtd fundamental types.