xtd 0.2.0
Loading...
Searching...
No Matches
__as_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 {
35 template<>
36 inline string as<string>(std::any value) {
37 return xtd::convert::to_string(value);
38 }
39
57 template<>
58 inline string as<string>(bool value) {
59 return xtd::convert::to_string(value);
60 }
61
79 template<>
80 inline string as<string>(xtd::byte value) {
81 return xtd::convert::to_string(value);
82 }
83
103 template<>
104 inline string as<string>(xtd::byte value, xtd::byte from_base) {
105 return xtd::convert::to_string(value, from_base);
106 }
107
126 template<>
127 inline string as<string>(char value) {
128 return xtd::convert::to_string(value);
129 }
130
131#if defined(__xtd__cpp_lib_char8_t)
150 template<>
151 inline string as<string>(char8 value) {
152 return xtd::convert::to_string(value);
153 }
154#endif
155
174 template<>
175 inline string as<string>(char16 value) {
176 return xtd::convert::to_string(value);
177 }
178
197 template<>
198 inline string as<string>(char32 value) {
199 return xtd::convert::to_string(value);
200 }
201
220 template<>
221 inline string as<string>(wchar value) {
222 return xtd::convert::to_string(value);
223 }
224
242 template<>
243 inline string as<string>(decimal value) {
244 return xtd::convert::to_string(value);
245 }
246
264 template<>
265 inline string as<string>(double value) {
266 return xtd::convert::to_string(value);
267 }
268
286 template<>
287 inline string as<string>(float value) {
288 return xtd::convert::to_string(value);
289 }
290
308 template<>
309 inline string as<string>(int16 value) {
310 return xtd::convert::to_string(value);
311 }
312
332 template<>
333 inline string as<string>(int16 value, xtd::byte from_base) {
334 return xtd::convert::to_string(value, from_base);
335 }
336
354 template<>
355 inline string as<string>(int32 value) {
356 return xtd::convert::to_string(value);
357 }
358
378 template<>
379 inline string as<string>(int32 value, xtd::byte from_base) {
380 return xtd::convert::to_string(value, from_base);
381 }
382
400 template<>
401 inline string as<string>(int64 value) {
402 return xtd::convert::to_string(value);
403 }
404
424 template<>
425 inline string as<string>(int64 value, xtd::byte from_base) {
426 return xtd::convert::to_string(value, from_base);
427 }
428
446 template<>
447 inline string as<string>(slong value) {
448 return xtd::convert::to_string(value);
449 }
450
470 template<>
471 inline string as<string>(slong value, xtd::byte from_base) {
472 return xtd::convert::to_string(value, from_base);
473 }
474
492 template<>
493 inline string as<string>(sbyte value) {
494 return xtd::convert::to_string(value);
495 }
496
516 template<>
517 inline string as<string>(sbyte value, xtd::byte from_base) {
518 return xtd::convert::to_string(value, from_base);
519 }
520
538 template<>
539 inline string as<string>(uint16 value) {
540 return xtd::convert::to_string(value);
541 }
542
562 template<>
563 inline string as<string>(uint16 value, xtd::byte from_base) {
564 return xtd::convert::to_string(value, from_base);
565 }
566
584 template<>
585 inline string as<string>(uint32 value) {
586 return xtd::convert::to_string(value);
587 }
588
608 template<>
609 inline string as<string>(uint32 value, xtd::byte from_base) {
610 return xtd::convert::to_string(value, from_base);
611 }
612
630 template<>
631 inline string as<string>(uint64 value) {
632 return xtd::convert::to_string(value);
633 }
634
654 template<>
655 inline string as<string>(uint64 value, xtd::byte from_base) {
656 return xtd::convert::to_string(value, from_base);
657 }
658
676 template<>
677 inline string as<string>(xtd::ulong value) {
678 return xtd::convert::to_string(value);
679 }
680
700 template<>
701 inline string as<string>(xtd::ulong value, xtd::byte from_base) {
702 return xtd::convert::to_string(value, from_base);
703 }
704}
Contains __xtd_std_version definitions.
static string to_string(std::any value)
Convert std::any to string.
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
string as< string >(std::any value)
Casts a type into another type.
Definition __as_string.h:36
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10