xtd 0.2.0
types

Definition

Types definitions.

Collaboration diagram for types:

Classes

class  xtd::date_time
 Represents an instant in time, typically expressed as a date and time of day. More...
 
class  xtd::enum_object< enum_t >
 Provides the base class for enumerations. More...
 
class  xtd::enum_object< std::nullptr_t >
 Provides the base class for enumerations. More...
 
class  xtd::type_object
 Represents type declarations: class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types. More...
 

Variables

std::nullptr_t xtd::null
 Represents a null pointer value. More...
 

Boxed types

using xtd::byte_object = box_integer< xtd::byte >
 Represent a boxed byte. More...
 
using xtd::char16_object = box_char< char16 >
 Represent a boxed char16. More...
 
using xtd::char32_object = box_char< char32 >
 Represent a boxed char32. More...
 
using xtd::char8_object = box_char< char8 >
 Represent a boxed char8. More...
 
using xtd::char_object = box_char< char >
 Represent a boxed char. More...
 
using xtd::decimal_object = box_floating_point< decimal >
 Represent a boxed decimal. More...
 
using xtd::double_object = box_floating_point< double >
 Represent a boxed double. More...
 
using xtd::int16_object = box_integer< int16 >
 Represent a boxed int16. More...
 
using xtd::int32_object = box_integer< int32 >
 Represent a boxed int32. More...
 
using xtd::int64_object = box_integer< int64 >
 Represent a boxed int64. More...
 
using xtd::intptr_object = box_integer< intptr >
 Represent a boxed intptr. More...
 
using xtd::sbyte_object = box_integer< sbyte >
 Represent a boxed sbyte. More...
 
using xtd::single_object = box_floating_point< float >
 Represent a boxed single. More...
 
using xtd::slong_object = box_integer< slong >
 Represent a boxed int16. More...
 
using xtd::tick = std::ratio< 1LL, 10000000LL >
 Represents a tick (1 tick = 100 nanoseconds). More...
 
using xtd::ticks = std::chrono::duration< int64, tick >
 Represents a tick duration. More...
 
using xtd::uint16_object = box_integer< uint16 >
 Represent a boxed uint16. More...
 
using xtd::uint32_object = box_integer< uint32 >
 Represent a boxed uint32. More...
 
using xtd::uint64_object = box_integer< uint64 >
 Represent a boxed uint64. More...
 
using xtd::uintptr_object = box_integer< uintptr >
 Represent a boxed uintptr. More...
 
using xtd::ulong_object = box_integer< ulong >
 Represent a boxed ulong. More...
 
using xtd::wchar_object = box_char< wchar >
 Represent a boxed wchar. More...
 

Native types

using xtd::bool_ = bool
 Represents a boolean. More...
 
using xtd::byte = uint_least8_t
 Represents a 8-bit unsigned integer. More...
 
using xtd::char_ = char
 Represents a character. More...
 
using xtd::char8 = char8_t
 Represents a 8-bit unicode character. More...
 
using xtd::char16 = char16_t
 Represents a 16-bit unicode character. More...
 
using xtd::char32 = char32_t
 Represents a 32-bit unicode character. More...
 
using xtd::decimal = long double
 Represents a decimal-precision floating-point number. More...
 
using xtd::double_ = double
 Represents a double-precision floating-point number. More...
 
using xtd::int16 = int_least16_t
 Represents a 16-bit signed integer. More...
 
using xtd::int32 = int_least32_t
 Represents a 32-bit signed integer. More...
 
using xtd::int64 = int_least64_t
 Represents a 64-bit signed integer. More...
 
using xtd::intptr = intmax_t
 Represent a pointer or a handle. More...
 
using xtd::ptrdiff = std::ptrdiff_t
 Represent the signed integer type of the result of subtracting two pointers. More...
 
using xtd::sbyte = int_least8_t
 Represents a 8-bit signed integer. More...
 
using xtd::single = float
 Represents a single-precision floating-point number. More...
 
using xtd::size = size_t
 Represents a size of any object in bytes. More...
 
using xtd::slong = __slong__
 Represents a 32-bit or 64-bit signed integer. More...
 
using xtd::type = std::type_info
 Stores information about a type. More...
 
using xtd::uint16 = uint_least16_t
 Represents a 16-bit unsigned integer. More...
 
using xtd::uint32 = uint_least32_t
 Represents a 32-bit unsigned integer. More...
 
using xtd::uint64 = uint_least64_t
 Represents a 64-bit unsigned integer. More...
 
using xtd::uintptr = uintmax_t
 Represent a pointer or a handle. More...
 
using xtd::ulong = __ulong__
 Represents a 32-bit or 64-bit unsigned integer. More...
 
using xtd::wchar = wchar_t
 Represents a wide character. More...
 

Typedef Documentation

◆ bool_

using xtd::bool_ = typedef bool

#include <xtd.core/include/xtd/types.h>

Represents a boolean.

Header
#include <xtd/bool>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ byte

using xtd::byte = typedef uint_least8_t

#include <xtd.core/include/xtd/types.h>

Represents a 8-bit unsigned integer.

Header
#include <xtd/byte>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ byte_object

#include <xtd.core/include/xtd/byte_object.h>

Represent a boxed byte.

Header
#include <xtd/byte_object>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::byte_object.
auto stringer = [](const object& value) {return value.to_string();};
xtd::byte unboxed_object = 42;
byte_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ char16

using xtd::char16 = typedef char16_t

#include <xtd.core/include/xtd/types.h>

Represents a 16-bit unicode character.

Header
#include <xtd/char16>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ char16_object

#include <xtd.core/include/xtd/char16_object.h>

Represent a boxed char16.

Header
#include <xtd/char16_object>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::char16_object.
auto stringer = [](const object& value) {return value.to_string();};
char16 unboxed_object = u'a';
char16_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = a;

◆ char32

using xtd::char32 = typedef char32_t

#include <xtd.core/include/xtd/types.h>

Represents a 32-bit unicode character.

Header
#include <xtd/char32>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ char32_object

#include <xtd.core/include/xtd/char32_object.h>

Represent a boxed char32.

Header
#include <xtd/char32_object>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::char32_object.
auto stringer = [](const object& value) {return value.to_string();};
char32 unboxed_object = U'a';
char32_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = a;

◆ char8

using xtd::char8 = typedef char8_t

#include <xtd.core/include/xtd/types.h>

Represents a 8-bit unicode character.

Header
#include <xtd/char8>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ char8_object

using xtd::char8_object = typedef box_char<char8>

#include <xtd.core/include/xtd/char8_object.h>

Represent a boxed char8.

Header
#include <xtd/char8_object>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::char8_object.
auto stringer = [](const object& value) {return value.to_string();};
char8 unboxed_object = u8'a';
char8_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = a;

◆ char_

using xtd::char_ = typedef char

#include <xtd.core/include/xtd/types.h>

Represents a character.

Header
#include <xtd/char>
Namespace
xtd
Library
xtd.core
Remarks
Represents a 32-bit unicode character on Linux and many other non-Windows systems, but a 16-bit unicode character on Windows.
For more information about types, see Native types, boxing and unboxing.

◆ char_object

using xtd::char_object = typedef box_char<char>

#include <xtd.core/include/xtd/char_object.h>

Represent a boxed char.

Header
#include <xtd/char_object>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::char_object.
auto stringer = [](const object& value) {return value.to_string();};
char unboxed_object = 'a';
char_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = a;

◆ decimal

using xtd::decimal = typedef long double

#include <xtd.core/include/xtd/types.h>

Represents a decimal-precision floating-point number.

Header
#include <xtd/decimal>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ decimal_object

#include <xtd.core/include/xtd/decimal_object.h>

Represent a boxed decimal.

Header
#include <xtd/decimal_object>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::double_object.
auto stringer = [](const object& value) {return value.to_string();};
decimal unboxed_object = 3.14;
decimal_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 3.14;

◆ double_

using xtd::double_ = typedef double

#include <xtd.core/include/xtd/types.h>

Represents a double-precision floating-point number.

Header
#include <xtd/double>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ double_object

using xtd::double_object = typedef box_floating_point<double>

#include <xtd.core/include/xtd/double_object.h>

Represent a boxed double.

Header
#include <xtd/double_object>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::double_object.
auto stringer = [](const object& value) {return value.to_string();};
double unboxed_object = 3.14;
double_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 3.14;

◆ int16

using xtd::int16 = typedef int_least16_t

#include <xtd.core/include/xtd/types.h>

Represents a 16-bit signed integer.

Header
#include <xtd/int16>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ int16_object

#include <xtd.core/include/xtd/int16_object.h>

Represent a boxed int16.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::int16_object.
auto stringer = [](const object& value) {return value.to_string();};
int16 unboxed_object = 42;
int16_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ int32

using xtd::int32 = typedef int_least32_t

#include <xtd.core/include/xtd/types.h>

Represents a 32-bit signed integer.

Header
#include <xtd/int32>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ int32_object

#include <xtd.core/include/xtd/int32_object.h>

Represent a boxed int32.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::int32_object.
auto stringer = [](const object& value) {return value.to_string();};
int32 unboxed_object = 42;
int32_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;
Examples:
console_out.cpp.

◆ int64

using xtd::int64 = typedef int_least64_t

#include <xtd.core/include/xtd/types.h>

Represents a 64-bit signed integer.

Header
#include <xtd/int64>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ int64_object

#include <xtd.core/include/xtd/int64_object.h>

Represent a boxed int64.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::int64_object.
auto stringer = [](const object& value) {return value.to_string();};
int64 unboxed_object = 42;
int64_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ intptr

using xtd::intptr = typedef intmax_t

#include <xtd.core/include/xtd/types.h>

Represent a pointer or a handle.

Header
#include <xtd/intptr>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ intptr_object

#include <xtd.core/include/xtd/intptr_object.h>

Represent a boxed intptr.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::intptr_object.
auto stringer = [](const object& value) {return value.to_string();};
intptr unboxed_object = 42;
intptr_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ ptrdiff

using xtd::ptrdiff = typedef std::ptrdiff_t

#include <xtd.core/include/xtd/types.h>

Represent the signed integer type of the result of subtracting two pointers.

Header
#include <xtd/ptrdiff>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ sbyte

using xtd::sbyte = typedef int_least8_t

#include <xtd.core/include/xtd/types.h>

Represents a 8-bit signed integer.

Header
#include <xtd/sbyte>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ sbyte_object

#include <xtd.core/include/xtd/sbyte_object.h>

Represent a boxed sbyte.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::sbyte_object.
auto stringer = [](const object& value) {return value.to_string();};
sbyte unboxed_object = 42;
sbyte_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ single

using xtd::single = typedef float

#include <xtd.core/include/xtd/types.h>

Represents a single-precision floating-point number.

Header
#include <xtd/single>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ single_object

using xtd::single_object = typedef box_floating_point<float>

#include <xtd.core/include/xtd/single_object.h>

Represent a boxed single.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::single_object.
auto stringer = [](const object& value) {return value.to_string();};
float unboxed_object = 3.14f;
single_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 3.14;

◆ size

using xtd::size = typedef size_t

#include <xtd.core/include/xtd/types.h>

Represents a size of any object in bytes.

Header
#include <xtd/size>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples:
button2.cpp, button3.cpp, calculator.cpp, colored_tab_pages.cpp, demo.cpp, form.cpp, images.cpp, tutorial_communicate.cpp, user_dialog.cpp, and user_dialog_show_sheet.cpp.

◆ slong

using xtd::slong = typedef __slong__

#include <xtd.core/include/xtd/types.h>

Represents a 32-bit or 64-bit signed integer.

Header
#include <xtd/slong>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ slong_object

#include <xtd.core/include/xtd/slong_object.h>

Represent a boxed int16.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd:slong_object.
auto stringer = [](const object& value) {return value.to_string();};
slong unboxed_object = 42;
slong_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ tick

using xtd::tick = typedef std::ratio<1LL, 10000000LL>

#include <xtd.core/include/xtd/tick.h>

Represents a tick (1 tick = 100 nanoseconds).

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ ticks

using xtd::ticks = typedef std::chrono::duration<int64, tick>

#include <xtd.core/include/xtd/ticks.h>

Represents a tick duration.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples:
console_firework.cpp, and date_time_max_value.cpp.

◆ type

using xtd::type = typedef std::type_info

#include <xtd.core/include/xtd/types.h>

Stores information about a type.

Header
#include <xtd/type>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples:
enum_class_flags_without_helpers.cpp.

◆ uint16

using xtd::uint16 = typedef uint_least16_t

#include <xtd.core/include/xtd/types.h>

Represents a 16-bit unsigned integer.

Header
#include <xtd/uint16>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ uint16_object

#include <xtd.core/include/xtd/uint16_object.h>

Represent a boxed uint16.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::uint16_object.
auto stringer = [](const object& value) {return value.to_string();};
uint16 unboxed_object = 42;
uint16_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ uint32

using xtd::uint32 = typedef uint_least32_t

#include <xtd.core/include/xtd/types.h>

Represents a 32-bit unsigned integer.

Header
#include <xtd/uint32>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ uint32_object

#include <xtd.core/include/xtd/uint32_object.h>

Represent a boxed uint32.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::uint32_object.
auto stringer = [](const object& value) {return value.to_string();};
uint32 unboxed_object = 42;
uint32_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ uint64

using xtd::uint64 = typedef uint_least64_t

#include <xtd.core/include/xtd/types.h>

Represents a 64-bit unsigned integer.

Header
#include <xtd/uint64>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ uint64_object

#include <xtd.core/include/xtd/uint64_object.h>

Represent a boxed uint64.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::uint64_object.
auto stringer = [](const object& value) {return value.to_string();};
uint64 unboxed_object = 42;
uint64_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ uintptr

using xtd::uintptr = typedef uintmax_t

#include <xtd.core/include/xtd/types.h>

Represent a pointer or a handle.

Header
#include <xtd/uintptr>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ uintptr_object

#include <xtd.core/include/xtd/uintptr_object.h>

Represent a boxed uintptr.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::uintptr_object.
auto stringer = [](const object& value) {return value.to_string();};
uintptr unboxed_object = 42;
uintptr_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ ulong

using xtd::ulong = typedef __ulong__

#include <xtd.core/include/xtd/types.h>

Represents a 32-bit or 64-bit unsigned integer.

Header
#include <xtd/ulong>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ ulong_object

#include <xtd.core/include/xtd/ulong_object.h>

Represent a boxed ulong.

Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::ulong_object.
auto stringer = [](const object& value) {return value.to_string();};
ulong unboxed_object = 42;
ulong_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

◆ wchar

using xtd::wchar = typedef wchar_t

#include <xtd.core/include/xtd/types.h>

Represents a wide character.

Header
#include <xtd/wchar>
Namespace
xtd
Library
xtd.core
Remarks
Represents a 32-bit unicode character on Linux and many other non-Windows systems, but a 16-bit unicode character on Windows.
For more information about types, see Native types, boxing and unboxing.

◆ wchar_object

using xtd::wchar_object = typedef box_char<wchar>

#include <xtd.core/include/xtd/wchar_object.h>

Represent a boxed wchar.

Header
#include <xtd/wchar_object>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.
Examples
The following example shows how to create and use xtd::wchar_object.
auto stringer = [](const object& value) {return value.to_string();};
wchar unboxed_object = L'a';
wchar_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = a;

Variable Documentation

◆ null

std::nullptr_t xtd::null

#include <xtd.core/include/xtd/types.h>

Represents a null pointer value.

Header
#include <xtd/null>
Namespace
xtd
Library
xtd.core
Examples
std::unique_ptr<foo_class> foo = std::make_unique<foo_class>();
...
foo = null; // release the unique pointer.
Examples:
format_nullptr.cpp.