xtd 0.2.0
Loading...
Searching...
No Matches
__as_std_string.h
Go to the documentation of this file.
1
3#pragma once
4
6#if !defined(__XTD_CORE_INTERNAL__)
7#error "Do not include this file: Internal use only"
8#endif
10
11#define __XTD_STD_INTERNAL__
12#include "__xtd_std_version.h"
13#undef __XTD_STD_INTERNAL__
14
16namespace xtd {
32 template<>
33 inline std::string as<std::string>(const std::string& value) {
35 }
40 template<>
41 inline std::string as<std::string>(std::string& value) {
43 }
44
60 template<>
61 inline xtd::string as<xtd::string>(const std::string& value) {
63 }
64
80 template<>
81 inline xtd::string as<xtd::string>(std::string& value) {
83 }
84
85#if defined(__xtd__cpp_lib_char8_t)
101 template<>
102 inline std::u8string as<std::u8string>(const std::string& value) {
104 }
105
121 template<>
122 inline std::u8string as<std::u8string>(std::string& value) {
124 }
125#endif
126
142 template<>
143 inline std::u16string as<std::u16string>(const std::string& value) {
145 }
146
162 template<>
163 inline std::u16string as<std::u16string>(std::string& value) {
165 }
166
182 template<>
183 inline std::u32string as<std::u32string>(const std::string& value) {
185 }
186
202 template<>
203 inline std::u32string as<std::u32string>(std::string& value) {
205 }
206
222 template<>
223 inline std::wstring as<std::wstring>(const std::string& value) {
225 }
226
242 template<>
243 inline std::wstring as<std::wstring>(std::string& value) {
245 }
246
262 template<>
263 inline std::string as<std::string>(const char* value) {
264 return xtd::convert_string::to_string(value);
265 }
266
282 template<>
283 inline xtd::string as<xtd::string>(const char* value) {
285 }
286
287#if defined(__xtd__cpp_lib_char8_t)
303 template<>
304 inline std::u8string as<std::u8string>(const char* value) {
306 }
307#endif
308
324 template<>
325 inline std::u16string as<std::u16string>(const char* value) {
327 }
328
344 template<>
345 inline std::u32string as<std::u32string>(const char* value) {
347 }
348
364 template<>
365 inline std::wstring as<std::wstring>(const char* value) {
367 }
368
384 template<>
385 inline std::string as<std::string>(char* value) {
386 return xtd::convert_string::to_string(value);
387 }
388
404 template<>
405 inline xtd::string as<xtd::string>(char* value) {
407 }
408
409#if defined(__xtd__cpp_lib_char8_t)
425 template<>
426 inline std::u8string as<std::u8string>(char* value) {
428 }
429#endif
430
446 template<>
447 inline std::u16string as<std::u16string>(char* value) {
449 }
450
466 template<>
467 inline std::u32string as<std::u32string>(char* value) {
469 }
470
486 template<>
487 inline std::wstring as<std::wstring>(char* value) {
489 }
490
506 template<>
507 inline std::string as<std::string>(const xtd::string& value) {
508 return xtd::convert_string::to_string(value);
509 }
510
526 template<>
527 inline std::string as<std::string>(xtd::string& value) {
528 return xtd::convert_string::to_string(value);
529 }
530
546 template<>
547 inline xtd::string as<xtd::string>(const xtd::string& value) {
549 }
550
566 template<>
567 inline xtd::string as<xtd::string>(xtd::string& value) {
569 }
570
571#if defined(__xtd__cpp_lib_char8_t)
587 template<>
588 inline std::u8string as<std::u8string>(const xtd::string& value) {
590 }
591
607 template<>
608 inline std::u8string as<std::u8string>(xtd::string& value) {
610 }
611#endif
612
628 template<>
629 inline std::u16string as<std::u16string>(const xtd::string& value) {
631 }
632
648 template<>
649 inline std::u16string as<std::u16string>(xtd::string& value) {
651 }
652
668 template<>
669 inline std::u32string as<std::u32string>(const xtd::string& value) {
671 }
672
688 template<>
689 inline std::u32string as<std::u32string>(xtd::string& value) {
691 }
692
708 template<>
709 inline std::wstring as<std::wstring>(const xtd::string& value) {
711 }
712
728 template<>
729 inline std::wstring as<std::wstring>(xtd::string& value) {
731 }
732
733#if defined(__xtd__cpp_lib_char8_t)
749 template<>
750 inline std::string as<std::string>(const std::u8string& value) {
751 return xtd::convert_string::to_string(value);
752 }
753
769 template<>
770 inline std::string as<std::string>(std::u8string& value) {
771 return xtd::convert_string::to_string(value);
772 }
773
789 template<>
790 inline xtd::string as<xtd::string>(const std::u8string& value) {
792 }
793
809 template<>
810 inline xtd::string as<xtd::string>(std::u8string& value) {
812 }
813
829 template<>
830 inline std::u8string as<std::u8string>(const std::u8string& value) {
832 }
833
849 template<>
850 inline std::u8string as<std::u8string>(std::u8string& value) {
852 }
853
869 template<>
870 inline std::u16string as<std::u16string>(const std::u8string& value) {
872 }
873
889 template<>
890 inline std::u16string as<std::u16string>(std::u8string& value) {
892 }
893
909 template<>
910 inline std::u32string as<std::u32string>(const std::u8string& value) {
912 }
913
929 template<>
930 inline std::u32string as<std::u32string>(std::u8string& value) {
932 }
933
949 template<>
950 inline std::wstring as<std::wstring>(const std::u8string& value) {
952 }
953
969 template<>
970 inline std::wstring as<std::wstring>(std::u8string& value) {
972 }
973#endif
974
975#if defined(__xtd__cpp_lib_char8_t)
991 template<>
992 inline std::string as<std::string>(const char8* value) {
993 return xtd::convert_string::to_string(value);
994 }
995
1011 template<>
1012 inline xtd::string as<xtd::string>(const char8* value) {
1013 return xtd::convert_string::to_ustring(value);
1014 }
1015
1031 template<>
1032 inline std::u8string as<std::u8string>(const char8* value) {
1034 }
1035
1051 template<>
1052 inline std::u16string as<std::u16string>(const char8* value) {
1054 }
1055
1071 template<>
1072 inline std::u32string as<std::u32string>(const char8* value) {
1074 }
1075
1091 template<>
1092 inline std::wstring as<std::wstring>(const char8* value) {
1093 return xtd::convert_string::to_wstring(value);
1094 }
1095
1111 template<>
1112 inline std::string as<std::string>(char8* value) {
1113 return xtd::convert_string::to_string(value);
1114 }
1115
1131 template<>
1132 inline xtd::string as<xtd::string>(char8* value) {
1133 return xtd::convert_string::to_ustring(value);
1134 }
1135
1151 template<>
1152 inline std::u8string as<std::u8string>(char8* value) {
1154 }
1155
1171 template<>
1172 inline std::u16string as<std::u16string>(char8* value) {
1174 }
1175
1191 template<>
1192 inline std::u32string as<std::u32string>(char8* value) {
1194 }
1195
1211 template<>
1212 inline std::wstring as<std::wstring>(char8* value) {
1213 return xtd::convert_string::to_wstring(value);
1214 }
1215#endif
1216
1232 template<>
1233 inline std::string as<std::string>(const std::u16string& value) {
1234 return xtd::convert_string::to_string(value);
1235 }
1236
1252 template<>
1253 inline std::string as<std::string>(std::u16string& value) {
1254 return xtd::convert_string::to_string(value);
1255 }
1256
1272 template<>
1273 inline xtd::string as<xtd::string>(const std::u16string& value) {
1274 return xtd::convert_string::to_ustring(value);
1275 }
1276
1292 template<>
1293 inline xtd::string as<xtd::string>(std::u16string& value) {
1294 return xtd::convert_string::to_ustring(value);
1295 }
1296
1297#if defined(__xtd__cpp_lib_char8_t)
1313 template<>
1314 inline std::u8string as<std::u8string>(const std::u16string& value) {
1316 }
1317
1333 template<>
1334 inline std::u8string as<std::u8string>(std::u16string& value) {
1336 }
1337#endif
1338
1354 template<>
1355 inline std::u16string as<std::u16string>(const std::u16string& value) {
1357 }
1358
1374 template<>
1375 inline std::u16string as<std::u16string>(std::u16string& value) {
1377 }
1378
1394 template<>
1395 inline std::u32string as<std::u32string>(const std::u16string& value) {
1397 }
1398
1414 template<>
1415 inline std::u32string as<std::u32string>(std::u16string& value) {
1417 }
1418
1434 template<>
1435 inline std::wstring as<std::wstring>(const std::u16string& value) {
1436 return xtd::convert_string::to_wstring(value);
1437 }
1438
1454 template<>
1455 inline std::wstring as<std::wstring>(std::u16string& value) {
1456 return xtd::convert_string::to_wstring(value);
1457 }
1458
1474 template<>
1475 inline std::string as<std::string>(const char16* value) {
1476 return xtd::convert_string::to_string(value);
1477 }
1478
1494 template<>
1495 inline xtd::string as<xtd::string>(const char16* value) {
1496 return xtd::convert_string::to_ustring(value);
1497 }
1498
1499#if defined(__xtd__cpp_lib_char8_t)
1515 template<>
1516 inline std::u8string as<std::u8string>(const char16* value) {
1518 }
1519#endif
1520
1536 template<>
1537 inline std::u16string as<std::u16string>(const char16* value) {
1539 }
1540
1556 template<>
1557 inline std::u32string as<std::u32string>(const char16* value) {
1559 }
1560
1576 template<>
1577 inline std::wstring as<std::wstring>(const char16* value) {
1578 return xtd::convert_string::to_wstring(value);
1579 }
1580
1596 template<>
1597 inline std::string as<std::string>(char16* value) {
1598 return xtd::convert_string::to_string(value);
1599 }
1600
1616 template<>
1617 inline xtd::string as<xtd::string>(char16* value) {
1618 return xtd::convert_string::to_ustring(value);
1619 }
1620
1621#if defined(__xtd__cpp_lib_char8_t)
1637 template<>
1638 inline std::u8string as<std::u8string>(char16* value) {
1640 }
1641#endif
1642
1658 template<>
1659 inline std::u16string as<std::u16string>(char16* value) {
1661 }
1662
1678 template<>
1679 inline std::u32string as<std::u32string>(char16* value) {
1681 }
1682
1698 template<>
1699 inline std::wstring as<std::wstring>(char16* value) {
1700 return xtd::convert_string::to_wstring(value);
1701 }
1702
1718 template<>
1719 inline std::string as<std::string>(const std::u32string& value) {
1720 return xtd::convert_string::to_string(value);
1721 }
1722
1738 template<>
1739 inline std::string as<std::string>(std::u32string& value) {
1740 return xtd::convert_string::to_string(value);
1741 }
1742
1758 template<>
1759 inline xtd::string as<xtd::string>(const std::u32string& value) {
1760 return xtd::convert_string::to_ustring(value);
1761 }
1762
1778 template<>
1779 inline xtd::string as<xtd::string>(std::u32string& value) {
1780 return xtd::convert_string::to_ustring(value);
1781 }
1782
1783#if defined(__xtd__cpp_lib_char8_t)
1799 template<>
1800 inline std::u8string as<std::u8string>(const std::u32string& value) {
1802 }
1803
1819 template<>
1820 inline std::u8string as<std::u8string>(std::u32string& value) {
1822 }
1823#endif
1824
1840 template<>
1841 inline std::u16string as<std::u16string>(const std::u32string& value) {
1843 }
1844
1860 template<>
1861 inline std::u16string as<std::u16string>(std::u32string& value) {
1863 }
1864
1880 template<>
1881 inline std::u32string as<std::u32string>(const std::u32string& value) {
1883 }
1884
1900 template<>
1901 inline std::u32string as<std::u32string>(std::u32string& value) {
1903 }
1904
1920 template<>
1921 inline std::wstring as<std::wstring>(const std::u32string& value) {
1922 return xtd::convert_string::to_wstring(value);
1923 }
1924
1940 template<>
1941 inline std::wstring as<std::wstring>(std::u32string& value) {
1942 return xtd::convert_string::to_wstring(value);
1943 }
1944
1960 template<>
1961 inline std::string as<std::string>(const char32* value) {
1962 return xtd::convert_string::to_string(value);
1963 }
1964
1980 template<>
1981 inline xtd::string as<xtd::string>(const char32* value) {
1982 return xtd::convert_string::to_ustring(value);
1983 }
1984
1985#if defined(__xtd__cpp_lib_char8_t)
2001 template<>
2002 inline std::u8string as<std::u8string>(const char32* value) {
2004 }
2005#endif
2006
2022 template<>
2023 inline std::u16string as<std::u16string>(const char32* value) {
2025 }
2026
2042 template<>
2043 inline std::u32string as<std::u32string>(const char32* value) {
2045 }
2046
2062 template<>
2063 inline std::wstring as<std::wstring>(const char32* value) {
2064 return xtd::convert_string::to_wstring(value);
2065 }
2066
2082 template<>
2083 inline std::string as<std::string>(char32* value) {
2084 return xtd::convert_string::to_string(value);
2085 }
2086
2102 template<>
2103 inline xtd::string as<xtd::string>(char32* value) {
2104 return xtd::convert_string::to_ustring(value);
2105 }
2106
2107#if defined(__xtd__cpp_lib_char8_t)
2123 template<>
2124 inline std::u8string as<std::u8string>(char32* value) {
2126 }
2127#endif
2128
2144 template<>
2145 inline std::u16string as<std::u16string>(char32* value) {
2147 }
2148
2164 template<>
2165 inline std::u32string as<std::u32string>(char32* value) {
2167 }
2168
2184 template<>
2185 inline std::wstring as<std::wstring>(char32* value) {
2186 return xtd::convert_string::to_wstring(value);
2187 }
2188
2204 template<>
2205 inline std::string as<std::string>(const std::wstring& value) {
2206 return xtd::convert_string::to_string(value);
2207 }
2208
2224 template<>
2225 inline std::string as<std::string>(std::wstring& value) {
2226 return xtd::convert_string::to_string(value);
2227 }
2228
2244 template<>
2245 inline xtd::string as<xtd::string>(const std::wstring& value) {
2246 return xtd::convert_string::to_ustring(value);
2247 }
2248
2264 template<>
2265 inline xtd::string as<xtd::string>(std::wstring& value) {
2266 return xtd::convert_string::to_ustring(value);
2267 }
2268
2269#if defined(__xtd__cpp_lib_char8_t)
2285 template<>
2286 inline std::u8string as<std::u8string>(const std::wstring& value) {
2288 }
2289
2305 template<>
2306 inline std::u8string as<std::u8string>(std::wstring& value) {
2308 }
2309#endif
2310
2326 template<>
2327 inline std::u16string as<std::u16string>(const std::wstring& value) {
2329 }
2330
2346 template<>
2347 inline std::u16string as<std::u16string>(std::wstring& value) {
2349 }
2350
2366 template<>
2367 inline std::u32string as<std::u32string>(const std::wstring& value) {
2369 }
2370
2386 template<>
2387 inline std::u32string as<std::u32string>(std::wstring& value) {
2389 }
2390
2406 template<>
2407 inline std::wstring as<std::wstring>(const std::wstring& value) {
2408 return xtd::convert_string::to_wstring(value);
2409 }
2410
2426 template<>
2427 inline std::wstring as<std::wstring>(std::wstring& value) {
2428 return xtd::convert_string::to_wstring(value);
2429 }
2430
2446 template<>
2447 inline std::string as<std::string>(const wchar* value) {
2448 return xtd::convert_string::to_string(value);
2449 }
2450
2466 template<>
2467 inline xtd::string as<xtd::string>(const wchar* value) {
2468 return xtd::convert_string::to_ustring(value);
2469 }
2470
2471#if defined(__xtd__cpp_lib_char8_t)
2487 template<>
2488 inline std::u8string as<std::u8string>(const wchar* value) {
2490 }
2491#endif
2492
2508 template<>
2509 inline std::u16string as<std::u16string>(const wchar* value) {
2511 }
2512
2528 template<>
2529 inline std::u32string as<std::u32string>(const wchar* value) {
2531 }
2532
2548 template<>
2549 inline std::wstring as<std::wstring>(const wchar* value) {
2550 return xtd::convert_string::to_wstring(value);
2551 }
2552
2568 template<>
2569 inline std::string as<std::string>(wchar* value) {
2570 return xtd::convert_string::to_string(value);
2571 }
2572
2588 template<>
2589 inline xtd::string as<xtd::string>(wchar* value) {
2590 return xtd::convert_string::to_ustring(value);
2591 }
2592
2593#if defined(__xtd__cpp_lib_char8_t)
2609 template<>
2610 inline std::u8string as<std::u8string>(wchar* value) {
2612 }
2613#endif
2614
2630 template<>
2631 inline std::u16string as<std::u16string>(wchar* value) {
2633 }
2634
2650 template<>
2651 inline std::u32string as<std::u32string>(wchar* value) {
2653 }
2654
2670 template<>
2671 inline std::wstring as<std::wstring>(wchar* value) {
2672 return xtd::convert_string::to_wstring(value);
2673 }
2674}
Contains __xtd_std_version definitions.
Represents text as a sequence of character units.
Definition basic_string.h:79
static std::u32string to_u32string(const std::string &str) noexcept
Converts std::string to std::u32string.
static std::u8string to_u8string(const std::string &str) noexcept
Converts std::string to std::u8string.
static xtd::string to_ustring(const std::string &str) noexcept
Converts std::string to xtd::string.
static const std::string & to_string(const std::string &str) noexcept
Converts std::string to std::string.
static std::u16string to_u16string(const std::string &str) noexcept
Converts std::string to std::u16string.
static std::wstring to_wstring(const std::string &str) noexcept
Converts std::string to std::wstring.
char8_t char8
Represents a 8-bit unicode character.
Definition char8.h:27
wchar_t wchar
Represents a wide character.
Definition wchar.h:24
char16_t char16
Represents a 16-bit unicode character.
Definition char16.h:26
char32_t char32
Represents a 32-bit unicode character.
Definition char32.h:26
std::string as< std::string >(const std::string &value)
Casts a type into another type.
Definition __as_std_string.h:33
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10