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>
60 template<
typename char_t>
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();
77 thread_local
static std::u8string result;
79 return result.c_str();
85 thread_local
static std::u16string result;
87 return result.c_str();
91 thread_local
static std::u16string result;
93 return result.c_str();
98 thread_local
static std::u32string result;
100 return result.c_str();
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();
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::double type and xtd::double_object alias.
Contains xtd::single type and xtd::single_object alias.
Contains xtd::uintptr type and xtd::uintptr_object alias.
type_t unboxing(const xtd::box< type_t > &value) noexcept
Allows to unbox an object.
Definition: unboxing.h:40
static std::wstring to_wstring(const std::string &str) noexcept
Converts std::string to std::wstring.
Represents a boxed char object.
Definition: box_char.h:36
int_least8_t sbyte
Represents a 8-bit signed integer.
Definition: types.h:173
Represents a boxed object.
Definition: box.h:47
Contains xtd::size type and xtd::size_object alias.
Represents a boxed floating point object.
Definition: box_floating_point.h:39
long double decimal
Represents a decimal-precision floating-point number.
Definition: types.h:96
xtd::ustring to_string() const noexcept override
Returns a sxd::ustring that represents the current object.
Definition: box.h:113
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
static std::u32string to_u32string(const std::string &str) noexcept
Converts std::string to std::u32string.
const type_t & value() const noexcept
Gets the underlying value.
Definition: box.h:79
Contains xtd::char type and xtd::char_object alias.
uint_least16_t uint16
Represents a 16-bit unsigned integer.
Definition: types.h:228
Contains xtd::int64 type and xtd::int64_object alias.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
Contains xtd::char8 type and xtd::char8_object alias.
Contains xtd::char16 type and xtd::char16_object alias.
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:1063
static std::u8string to_u8string(const std::string &str) noexcept
Converts std::string to std::u8string.
Contains xtd::uint64 type and xtd::uint64_object alias.
Contains xtd::byte type and xtd::byte_object alias.
Contains xtd::int16 type and xtd::int16_object alias.
enum_type value() const noexcept
Gets the value of the enum.
Definition: enum_object.h:82
Contains xtd::wchar type and xtd::wchar_object alias.
Contains xtd::uint16 type and xtd::uint16_object alias.
Contains xtd::intptr type and xtd::intptr_object alias.
Represents a boxed integer object.
Definition: box_integer.h:36
Contains xtd::int32 type and xtd::int32_object alias.
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition: types.h:206
Contains xtd::char32 type and xtd::char32_object alias.
int_least16_t int16
Represents a 16-bit signed integer.
Definition: types.h:118
Provides the base class for enumerations.
Definition: enum_object.h:38
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
char32_t char32
Represents a 32-bit unicode character.
Definition: types.h:85
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition: types.h:272
The exception that is thrown for invalid casting or explicit conversion.
Definition: invalid_cast_exception.h:18
Contains xtd::uint32 type and xtd::uint32_object alias.
uint_least64_t uint64
Represents a 64-bit unsigned integer.
Definition: types.h:250
char8_t char8
Represents a 8-bit unicode character.
Definition: types.h:62
int_least64_t int64
Represents a 64-bit signed integer.
Definition: types.h:140
uint_least8_t byte
Represents a 8-bit unsigned integer.
Definition: types.h:39
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition: types.h:239
static std::u16string to_u16string(const std::string &str) noexcept
Converts std::string to std::u16string.
char16_t char16
Represents a 16-bit unicode character.
Definition: types.h:74
Contains xtd::sbyte type and xtd::sbyte_object alias.
wchar_t wchar
Represents a wide character.
Definition: types.h:284
Contains xtd::decimal type and xtd::decimal_object alias.