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