xtd 0.2.0
Loading...
Searching...
No Matches
__as_char.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 {
35 template<>
36 inline char as<char>(std::any value) {
37 return xtd::convert::to_char(value);
38 }
39
57 template<>
58 inline char as<char>(bool value) {
59 return xtd::convert::to_char(value);
60 }
61
79 template<>
80 inline char as<char>(xtd::byte value) {
81 return xtd::convert::to_char(value);
82 }
83
102 template<>
103 inline char as<char>(char value) {
104 return xtd::convert::to_char(value);
105 }
106
107#if defined(__xtd__cpp_lib_char8_t)
126 template<>
127 inline char as<char>(char8 value) {
128 return xtd::convert::to_char(value);
129 }
130#endif
131
150 template<>
151 inline char as<char>(char16 value) {
152 return xtd::convert::to_char(value);
153 }
154
173 template<>
174 inline char as<char>(char32 value) {
175 return xtd::convert::to_char(value);
176 }
177
196 template<>
197 inline char as<char>(wchar value) {
198 return xtd::convert::to_char(value);
199 }
200
218 template<>
219 inline char as<char>(decimal value) {
220 return xtd::convert::to_char(value);
221 }
222
240 template<>
241 inline char as<char>(double value) {
242 return xtd::convert::to_char(value);
243 }
244
262 template<>
263 inline char as<char>(float value) {
264 return xtd::convert::to_char(value);
265 }
266
284 template<>
285 inline char as<char>(int16 value) {
286 return xtd::convert::to_char(value);
287 }
288
306 template<>
307 inline char as<char>(int32 value) {
308 return xtd::convert::to_char(value);
309 }
310
328 template<>
329 inline char as<char>(int64 value) {
330 return xtd::convert::to_char(value);
331 }
332
350 template<>
351 inline char as<char>(slong value) {
352 return xtd::convert::to_char(value);
353 }
354
372 template<>
373 inline char as<char>(sbyte value) {
374 return xtd::convert::to_char(value);
375 }
376
394 template<>
395 inline char as<char>(uint16 value) {
396 return xtd::convert::to_char(value);
397 }
398
416 template<>
417 inline char as<char>(uint32 value) {
418 return xtd::convert::to_char(value);
419 }
420
438 template<>
439 inline char as<char>(uint64 value) {
440 return xtd::convert::to_char(value);
441 }
442
460 template<>
461 inline char as<char>(xtd::ulong value) {
462 return xtd::convert::to_char(value);
463 }
464
483 template<>
484 inline char as<char>(const xtd::string& value) {
485 return xtd::convert::to_char(value);
486 }
487
506 template<>
507 inline char as<char>(xtd::string& value) {
508 return xtd::convert::to_char(value);
509 }
510
529 template<>
530 inline char as<char>(const std::string& value) {
531 return xtd::convert::to_char(value);
532 }
533
552 template<>
553 inline char as<char>(std::string& value) {
554 return xtd::convert::to_char(value);
555 }
556
557#if defined(__xtd__cpp_lib_char8_t)
576 template<>
577 inline char as<char>(const std::u8string& value) {
578 return xtd::convert::to_char(value);
579 }
580
599 template<>
600 inline char as<char>(std::u8string& value) {
601 return xtd::convert::to_char(value);
602 }
603#endif
604
623 template<>
624 inline char as<char>(const std::u16string& value) {
625 return xtd::convert::to_char(value);
626 }
627
646 template<>
647 inline char as<char>(std::u16string& value) {
648 return xtd::convert::to_char(value);
649 }
650
669 template<>
670 inline char as<char>(const std::u32string& value) {
671 return xtd::convert::to_char(value);
672 }
673
692 template<>
693 inline char as<char>(std::u32string& value) {
694 return xtd::convert::to_char(value);
695 }
696
715 template<>
716 inline char as<char>(const std::wstring& value) {
717 return xtd::convert::to_char(value);
718 }
719
738 template<>
739 inline char as<char>(std::wstring& value) {
740 return xtd::convert::to_char(value);
741 }
742
761 template<>
762 inline char as<char>(const char* value) {
763 return xtd::convert::to_char(value);
764 }
765
784 template<>
785 inline char as<char>(char* value) {
786 return xtd::convert::to_char(value);
787 }
788
789#if defined(__xtd__cpp_lib_char8_t)
808 template<>
809 inline char as<char>(const char8* value) {
810 return xtd::convert::to_char(value);
811 }
812
831 template<>
832 inline char as<char>(char8* value) {
833 return xtd::convert::to_char(value);
834 }
835#endif
836
855 template<>
856 inline char as<char>(const char16* value) {
857 return xtd::convert::to_char(value);
858 }
859
878 template<>
879 inline char as<char>(char16* value) {
880 return xtd::convert::to_char(value);
881 }
882
901 template<>
902 inline char as<char>(const char32* value) {
903 return xtd::convert::to_char(value);
904 }
905
924 template<>
925 inline char as<char>(char32* value) {
926 return xtd::convert::to_char(value);
927 }
928
947 template<>
948 inline char as<char>(const wchar* value) {
949 return xtd::convert::to_char(value);
950 }
951
970 template<>
971 inline char as<char>(wchar* value) {
972 return xtd::convert::to_char(value);
973 }
974}
Contains __xtd_std_version definitions.
Represents text as a sequence of character units.
Definition basic_string.h:79
static char to_char(std::any value)
Convert std::any to char.
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
char as< char >(std::any value)
Casts a type into another type.
Definition __as_char.h:36
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10