39 template<
typename type_t>
43 template<
typename type_t>
46 template<
typename type_t>
49 template<
typename type_t>
52 inline const object&
unboxing(
const object& value)
noexcept {
return value;}
53 inline object&
unboxing(
object& value)
noexcept {
return value;}
55 inline const char*
unboxing(
const ustring& value)
noexcept {
return value.c_str();}
56 inline const char*
unboxing(ustring& value)
noexcept {
return value.c_str();}
58 template<
typename char_t>
59 inline const char_t*
unboxing(
const ustring& value) {
throw invalid_cast_exception(
"Invalid character type");}
60 template<
typename char_t>
61 inline const char_t*
unboxing(ustring& value) {
throw invalid_cast_exception(
"Invalid character type");}
64 inline const char* unboxing<char>(
const ustring& value) {
return value.c_str();}
66 inline const char* unboxing<char>(ustring& value) {
return value.c_str();}
68#if defined(__cpp_lib_char8_t)
70 inline const char8* unboxing<char8>(
const ustring& value) {
71 thread_local static std::u8string result;
73 return result.c_str();
76 inline const char8* unboxing<char8>(ustring& value) {
77 thread_local static std::u8string result;
79 return result.c_str();
84 inline const char16* unboxing<char16>(
const ustring& value) {
85 thread_local static std::u16string result;
87 return result.c_str();
90 inline const char16* unboxing<char16>(ustring& value) {
91 thread_local static std::u16string result;
93 return result.c_str();
97 inline const char32* unboxing<char32>(
const ustring& value) {
98 thread_local static std::u32string result;
100 return result.c_str();
103 inline const char32* unboxing<char32>(ustring& value) {
104 thread_local static std::u32string result;
106 return result.c_str();
110 inline const wchar* unboxing<wchar>(
const ustring& value) {
111 thread_local static std::wstring result;
113 return result.c_str();
116 inline const wchar* unboxing<wchar>(ustring& value) {
117 thread_local static std::wstring result;
119 return result.c_str();
147 inline char unboxing(
const char& value)
noexcept {
return value;}
148#if defined(__cpp_lib_char8_t)
154 inline char unboxing(
char& value)
noexcept {
return value;}
155#if defined(__cpp_lib_char8_t)
181 inline float unboxing(
const float& value)
noexcept {
return value;}
182 inline double unboxing(
const double& value)
noexcept {
return value;}
184 inline float unboxing(
float& value)
noexcept {
return value;}
185 inline double unboxing(
double& value)
noexcept {
return value;}
188 template<
typename type_t>
193 template<
typename type_t>
198 template<
typename type_t>
203 template<
typename type_t>
Contains xtd::byte type and xtd::byte_object alias.
Contains xtd::char16 type and xtd::char16_object alias.
Contains xtd::char32 type and xtd::char32_object alias.
Contains xtd::char8 type and xtd::char8_object alias.
Contains xtd::char type and xtd::char_object alias.
Represents a boxed char object.
Definition box_char.h:36
Represents a boxed floating point object.
Definition box_floating_point.h:39
Represents a boxed integer object.
Definition box_integer.h:50
Represents a boxed object.
Definition box.h:47
xtd::ustring to_string() const noexcept override
Returns a sxd::ustring that represents the current object.
Definition box.h:108
static std::u32string to_u32string(const std::string &str) noexcept
Converts std::string to std::u32string.
static std::u8string to_u8string(const std::string &str) noexcept
Converts std::string to std::u8string.
static std::u16string to_u16string(const std::string &str) noexcept
Converts std::string to std::u16string.
static std::wstring to_wstring(const std::string &str) noexcept
Converts std::string to std::wstring.
Provides the base class for enumerations.
Definition enum_object.h:38
Contains xtd::decimal type and xtd::decimal_object alias.
Contains xtd::double type and xtd::double_object alias.
type_t unboxing(const xtd::box< type_t > &value) noexcept
Allows to unbox an object.
Definition unboxing.h:40
char8_t char8
Represents a 8-bit unicode character.
Definition types.h:64
wchar_t wchar
Represents a wide character.
Definition types.h:286
int_least16_t int16
Represents a 16-bit signed integer.
Definition types.h:120
long double decimal
Represents a decimal-precision floating-point number.
Definition types.h:98
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition types.h:274
char16_t char16
Represents a 16-bit unicode character.
Definition types.h:76
int_least8_t sbyte
Represents a 8-bit signed integer.
Definition types.h:175
int_least64_t int64
Represents a 64-bit signed integer.
Definition types.h:142
uint_least16_t uint16
Represents a 16-bit unsigned integer.
Definition types.h:230
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
char32_t char32
Represents a 32-bit unicode character.
Definition types.h:87
uint_least64_t uint64
Represents a 64-bit unsigned integer.
Definition types.h:252
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition types.h:241
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition types.h:208
uint_least8_t byte
Represents a 8-bit unsigned integer.
Definition types.h:41
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition date_time.h:1080
Contains xtd::int16 type and xtd::int16_object alias.
Contains xtd::int32 type and xtd::int32_object alias.
Contains xtd::int64 type and xtd::int64_object alias.
Contains xtd::intptr type and xtd::intptr_object alias.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::sbyte type and xtd::sbyte_object alias.
Contains xtd::single type and xtd::single_object alias.
Contains xtd::uint16 type and xtd::uint16_object alias.
Contains xtd::uint32 type and xtd::uint32_object alias.
Contains xtd::uint64 type and xtd::uint64_object alias.
Contains xtd::uintptr type and xtd::uintptr_object alias.
Contains xtd::wchar type and xtd::wchar_object alias.
Contains xtd::drawing::size class.