xtd 0.2.0
Loading...
Searching...
No Matches
__as_char8.hpp
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.hpp"
13#undef __XTD_STD_INTERNAL__
14
16namespace xtd {
35 template<>
36 [[nodiscard]] inline auto as<xtd::char8>(xtd::any value) -> xtd::char8 {
37 return xtd::convert::to_char8(value);
38 }
39
57 template<>
58 [[nodiscard]] inline auto as<xtd::char8>(bool value) -> xtd::char8 {
59 return xtd::convert::to_char8(value);
60 }
61
79 template<>
80 [[nodiscard]] inline auto as<xtd::char8>(xtd::byte value) -> xtd::char8 {
81 return xtd::convert::to_char8(value);
82 }
83
102 template<>
103 [[nodiscard]] inline auto as<xtd::char8>(char value) -> xtd::char8 {
104 return xtd::convert::to_char8(value);
105 }
106
125 template<>
126 [[nodiscard]] inline auto as<xtd::char8>(xtd::char8 value) -> xtd::char8 {
127 return xtd::convert::to_char8(value);
128 }
129
148 template<>
149 [[nodiscard]] inline auto as<xtd::char8>(xtd::char16 value) -> xtd::char8 {
150 return xtd::convert::to_char8(value);
151 }
152
171 template<>
172 [[nodiscard]] inline auto as<xtd::char8>(xtd::char32 value) -> xtd::char8 {
173 return xtd::convert::to_char8(value);
174 }
175
194 template<>
195 [[nodiscard]] inline auto as<xtd::char8>(xtd::wchar value) -> xtd::char8 {
196 return xtd::convert::to_char8(value);
197 }
198
216 template<>
217 [[nodiscard]] inline auto as<xtd::char8>(xtd::decimal value) -> xtd::char8 {
218 return xtd::convert::to_char8(value);
219 }
220
238 template<>
239 [[nodiscard]] inline auto as<xtd::char8>(double value) -> xtd::char8 {
240 return xtd::convert::to_char8(value);
241 }
242
260 template<>
261 [[nodiscard]] inline auto as<xtd::char8>(float value) -> xtd::char8 {
262 return xtd::convert::to_char8(value);
263 }
264
282 template<>
283 [[nodiscard]] inline auto as<xtd::char8>(xtd::int16 value) -> xtd::char8 {
284 return xtd::convert::to_char8(value);
285 }
286
304 template<>
305 [[nodiscard]] inline auto as<xtd::char8>(xtd::int32 value) -> xtd::char8 {
306 return xtd::convert::to_char8(value);
307 }
308
326 template<>
327 [[nodiscard]] inline auto as<xtd::char8>(xtd::int64 value) -> xtd::char8 {
328 return xtd::convert::to_char8(value);
329 }
330
348 template<>
349 [[nodiscard]] inline auto as<xtd::char8>(xtd::slong value) -> xtd::char8 {
350 return xtd::convert::to_char8(value);
351 }
352
370 template<>
371 [[nodiscard]] inline auto as<xtd::char8>(xtd::sbyte value) -> xtd::char8 {
372 return xtd::convert::to_char8(value);
373 }
374
392 template<>
393 [[nodiscard]] inline auto as<xtd::char8>(xtd::uint16 value) -> xtd::char8 {
394 return xtd::convert::to_char8(value);
395 }
396
414 template<>
415 [[nodiscard]] inline auto as<xtd::char8>(xtd::uint32 value) -> xtd::char8 {
416 return xtd::convert::to_char8(value);
417 }
418
436 template<>
437 [[nodiscard]] inline auto as<xtd::char8>(xtd::uint64 value) -> xtd::char8 {
438 return xtd::convert::to_char8(value);
439 }
440
458 template<>
459 [[nodiscard]] inline auto as<xtd::char8>(xtd::ulong value) -> xtd::char8 {
460 return xtd::convert::to_char8(value);
461 }
462
481 template<>
482 [[nodiscard]] inline auto as<xtd::char8>(const xtd::string& value) -> xtd::char8 {
483 return xtd::convert::to_char8(value);
484 }
485
504 template<>
505 [[nodiscard]] inline auto as<xtd::char8>(xtd::string& value) -> xtd::char8 {
506 return xtd::convert::to_char8(value);
507 }
508
527 template<>
528 [[nodiscard]] inline auto as<xtd::char8>(const std::string& value) -> xtd::char8 {
529 return xtd::convert::to_char8(value);
530 }
531
550 template<>
551 [[nodiscard]] inline auto as<xtd::char8>(std::string& value) -> xtd::char8 {
552 return xtd::convert::to_char8(value);
553 }
554
573 template<>
574 [[nodiscard]] inline auto as<xtd::char8>(const std::u8string& value) -> xtd::char8 {
575 return xtd::convert::to_char8(value);
576 }
577
596 template<>
597 [[nodiscard]] inline auto as<xtd::char8>(std::u8string& value) -> xtd::char8 {
598 return xtd::convert::to_char8(value);
599 }
600
619 template<>
620 [[nodiscard]] inline auto as<xtd::char8>(const std::u16string& value) -> xtd::char8 {
621 return xtd::convert::to_char8(value);
622 }
623
642 template<>
643 [[nodiscard]] inline auto as<xtd::char8>(std::u16string& value) -> xtd::char8 {
644 return xtd::convert::to_char8(value);
645 }
646
665 template<>
666 [[nodiscard]] inline auto as<xtd::char8>(const std::u32string& value) -> xtd::char8 {
667 return xtd::convert::to_char8(value);
668 }
669
688 template<>
689 [[nodiscard]] inline auto as<xtd::char8>(std::u32string& value) -> xtd::char8 {
690 return xtd::convert::to_char8(value);
691 }
692
711 template<>
712 [[nodiscard]] inline auto as<xtd::char8>(const std::wstring& value) -> xtd::char8 {
713 return xtd::convert::to_char8(value);
714 }
715
734 template<>
735 [[nodiscard]] inline auto as<xtd::char8>(std::wstring& value) -> xtd::char8 {
736 return xtd::convert::to_char8(value);
737 }
738
757 template<>
758 [[nodiscard]] inline auto as<xtd::char8>(const char* value) -> xtd::char8 {
759 return xtd::convert::to_char8(value);
760 }
761
780 template<>
781 [[nodiscard]] inline auto as<xtd::char8>(char* value) -> xtd::char8 {
782 return xtd::convert::to_char8(value);
783 }
784
803 template<>
804 [[nodiscard]] inline auto as<xtd::char8>(const xtd::char8* value) -> xtd::char8 {
805 return xtd::convert::to_char8(value);
806 }
807
826 template<>
827 [[nodiscard]] inline auto as<xtd::char8>(xtd::char8* value) -> xtd::char8 {
828 return xtd::convert::to_char8(value);
829 }
830
849 template<>
850 [[nodiscard]] inline auto as<xtd::char8>(const xtd::char16* value) -> xtd::char8 {
851 return xtd::convert::to_char8(value);
852 }
853
872 template<>
873 [[nodiscard]] inline auto as<xtd::char8>(xtd::char16* value) -> xtd::char8 {
874 return xtd::convert::to_char8(value);
875 }
876
895 template<>
896 [[nodiscard]] inline auto as<xtd::char8>(const xtd::char32* value) -> xtd::char8 {
897 return xtd::convert::to_char8(value);
898 }
899
918 template<>
919 [[nodiscard]] inline auto as<xtd::char8>(xtd::char32* value) -> xtd::char8 {
920 return xtd::convert::to_char8(value);
921 }
922
941 template<>
942 [[nodiscard]] inline auto as<xtd::char8>(const xtd::wchar* value) -> xtd::char8 {
943 return xtd::convert::to_char8(value);
944 }
945
964 template<>
965 [[nodiscard]] inline auto as<xtd::char8>(xtd::wchar* value) -> xtd::char8 {
966 return xtd::convert::to_char8(value);
967 }
968}
static char8 to_char8(xtd::any value)
Convert xtd::any to char8.
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
std::int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
std::uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:26
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition slong.hpp:27
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
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition ulong.hpp:27
long double decimal
Represents a decimal-precision floating-point number.
Definition decimal.hpp:23
std::uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
std::int16_t int16
Represents a 16-bit signed integer.
Definition int16.hpp:23
std::uint64_t uint64
Represents a 64-bit unsigned integer.
Definition uint64.hpp:23
std::uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
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
auto as< xtd::char8 >(xtd::any value) -> xtd::char8
Casts a type into another type.
Definition __as_char8.hpp:36
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8