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