xtd 0.2.0
Loading...
Searching...
No Matches
__as_char8.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 {
17#if defined(__xtd__cpp_lib_char8_t)
36 template<>
37 inline char8 as<char8>(std::any value) {
38 return xtd::convert::to_char8(value);
39 }
40
58 template<>
59 inline char8 as<char8>(bool value) {
60 return xtd::convert::to_char8(value);
61 }
62
80 template<>
81 inline char8 as<char8>(xtd::byte value) {
82 return xtd::convert::to_char8(value);
83 }
84
103 template<>
104 inline char8 as<char8>(char value) {
105 return xtd::convert::to_char8(value);
106 }
107
126 template<>
127 inline char8 as<char8>(char8 value) {
128 return xtd::convert::to_char8(value);
129 }
130
149 template<>
150 inline char8 as<char8>(char16 value) {
151 return xtd::convert::to_char8(value);
152 }
153
172 template<>
173 inline char8 as<char8>(char32 value) {
174 return xtd::convert::to_char8(value);
175 }
176
195 template<>
196 inline char8 as<char8>(wchar value) {
197 return xtd::convert::to_char8(value);
198 }
199
217 template<>
218 inline char8 as<char8>(decimal value) {
219 return xtd::convert::to_char8(value);
220 }
221
239 template<>
240 inline char8 as<char8>(double value) {
241 return xtd::convert::to_char8(value);
242 }
243
261 template<>
262 inline char8 as<char8>(float value) {
263 return xtd::convert::to_char8(value);
264 }
265
283 template<>
284 inline char8 as<char8>(int16 value) {
285 return xtd::convert::to_char8(value);
286 }
287
305 template<>
306 inline char8 as<char8>(int32 value) {
307 return xtd::convert::to_char8(value);
308 }
309
327 template<>
328 inline char8 as<char8>(int64 value) {
329 return xtd::convert::to_char8(value);
330 }
331
349 template<>
350 inline char8 as<char8>(slong value) {
351 return xtd::convert::to_char8(value);
352 }
353
371 template<>
372 inline char8 as<char8>(sbyte value) {
373 return xtd::convert::to_char8(value);
374 }
375
393 template<>
394 inline char8 as<char8>(uint16 value) {
395 return xtd::convert::to_char8(value);
396 }
397
415 template<>
416 inline char8 as<char8>(uint32 value) {
417 return xtd::convert::to_char8(value);
418 }
419
437 template<>
438 inline char8 as<char8>(uint64 value) {
439 return xtd::convert::to_char8(value);
440 }
441
459 template<>
460 inline char8 as<char8>(xtd::ulong value) {
461 return xtd::convert::to_char8(value);
462 }
463
482 template<>
483 inline char8 as<char8>(const xtd::string& value) {
484 return xtd::convert::to_char8(value);
485 }
486
505 template<>
506 inline char8 as<char8>(xtd::string& value) {
507 return xtd::convert::to_char8(value);
508 }
509
528 template<>
529 inline char8 as<char8>(const std::string& value) {
530 return xtd::convert::to_char8(value);
531 }
532
551 template<>
552 inline char8 as<char8>(std::string& value) {
553 return xtd::convert::to_char8(value);
554 }
555
574 template<>
575 inline char8 as<char8>(const std::u8string& value) {
576 return xtd::convert::to_char8(value);
577 }
578
597 template<>
598 inline char8 as<char8>(std::u8string& value) {
599 return xtd::convert::to_char8(value);
600 }
601
620 template<>
621 inline char8 as<char8>(const std::u16string& value) {
622 return xtd::convert::to_char8(value);
623 }
624
643 template<>
644 inline char8 as<char8>(std::u16string& value) {
645 return xtd::convert::to_char8(value);
646 }
647
666 template<>
667 inline char8 as<char8>(const std::u32string& value) {
668 return xtd::convert::to_char8(value);
669 }
670
689 template<>
690 inline char8 as<char8>(std::u32string& value) {
691 return xtd::convert::to_char8(value);
692 }
693
712 template<>
713 inline char8 as<char8>(const std::wstring& value) {
714 return xtd::convert::to_char8(value);
715 }
716
735 template<>
736 inline char8 as<char8>(std::wstring& value) {
737 return xtd::convert::to_char8(value);
738 }
739
758 template<>
759 inline char8 as<char8>(const char* value) {
760 return xtd::convert::to_char8(value);
761 }
762
781 template<>
782 inline char8 as<char8>(char* value) {
783 return xtd::convert::to_char8(value);
784 }
785
804 template<>
805 inline char8 as<char8>(const char8* value) {
806 return xtd::convert::to_char8(value);
807 }
808
827 template<>
828 inline char8 as<char8>(char8* value) {
829 return xtd::convert::to_char8(value);
830 }
831
850 template<>
851 inline char8 as<char8>(const char16* value) {
852 return xtd::convert::to_char8(value);
853 }
854
873 template<>
874 inline char8 as<char8>(char16* value) {
875 return xtd::convert::to_char8(value);
876 }
877
896 template<>
897 inline char8 as<char8>(const char32* value) {
898 return xtd::convert::to_char8(value);
899 }
900
919 template<>
920 inline char8 as<char8>(char32* value) {
921 return xtd::convert::to_char8(value);
922 }
923
942 template<>
943 inline char8 as<char8>(const wchar* value) {
944 return xtd::convert::to_char8(value);
945 }
946
965 template<>
966 inline char8 as<char8>(wchar* value) {
967 return xtd::convert::to_char8(value);
968 }
969#endif
970}
Contains __xtd_std_version definitions.
Represents text as a sequence of character units.
Definition basic_string.h:79
static char8 to_char8(std::any value)
Convert std::any to char8.
int16_t int16
Represents a 16-bit signed integer.
Definition int16.h:23
char8_t char8
Represents a 8-bit unicode character.
Definition char8.h:27
wchar_t wchar
Represents a wide character.
Definition wchar.h:24
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
long double decimal
Represents a decimal-precision floating-point number.
Definition decimal.h:23
int64_t int64
Represents a 64-bit signed integer.
Definition int64.h:23
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition ulong.h:27
int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.h:23
char16_t char16
Represents a 16-bit unicode character.
Definition char16.h:26
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.h:23
char32_t char32
Represents a 32-bit unicode character.
Definition char32.h:26
uint64_t uint64
Represents a 64-bit unsigned integer.
Definition uint64.h:23
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.h:23
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.h:23
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition slong.h:27
char8 as< char8 >(std::any value)
Casts a type into another type.
Definition __as_char8.h:37
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10