xtd 0.2.0
types.h
Go to the documentation of this file.
1 #pragma once
5 #include <cstdint>
6 #include <string>
7 #include <typeinfo>
8 #include "core_export.h"
10 #define __XTD_CORE_CHAR8_T_INTERNAL__
11 #include "internal/__char8_t.h"
12 #undef __XTD_CORE_CHAR8_T_INTERNAL__
13 #define __XTD_TYPE_NATIVE__
14 #include <xtd/native/types.h>
15 #undef __XTD_TYPE_NATIVE__
16 
19 namespace xtd {
26  using byte = uint_least8_t;
27 
34  using char8 = char8_t;
35 
42  using char16 = char16_t;
43 
50  using char32 = char32_t;
51 
58  using decimal = long double;
59 
66  using int16 = int_least16_t;
67 
74  using int32 = int_least32_t;
75 
82  using int64 = int_least64_t;
83 
86  using intptr = intmax_t;
87 
100  extern core_export_ std::nullptr_t null;
101 
104  using ptrdiff = std::ptrdiff_t;
105 
112  using sbyte = int_least8_t;
113 
120  using size = size_t;
121 
128  using slong = __slong__; // Workaround: On linux 64 bits unfortunately 'int_least64_t' is an alias on 'long' and not on 'long long int' as other platforms. In order to avoid conflicts in operator or method overloads, it is necessary to give the type that is not taken into account.
129 
136  using type = std::type_info;
137 
144  using uint16 = uint_least16_t;
145 
152  using uint32 = uint_least32_t;
153 
160  using uint64 = uint_least64_t;
161 
168  using uintptr = uintmax_t;
169 
176  using ulong = __ulong__; // Workaround: On linux 64 bits unfortunately 'uint_least64_t' is an alias on 'unigned long' and not on 'unsigned long long int' as other platforms. In order to avoid conflicts in operator or method overloads, it is necessary to give the type that is not taken into account.
177 
185  using wchar = wchar_t;
186 }
std::type_info type
Stores information about a type.
Definition: types.h:136
std::ptrdiff_t ptrdiff
Represent the signed integer type of the result of subtracting two pointers.
Definition: types.h:104
intmax_t intptr
Represent a pointer or a handle.
Definition: types.h:86
int_least8_t sbyte
Represents a 8-bit signed integer.
Definition: types.h:112
long double decimal
Represents a decimal-precision floating-point number.
Definition: types.h:58
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
uint_least16_t uint16
Represents a 16-bit unsigned integer.
Definition: types.h:144
std::nullptr_t null
Represents a null pointer value.
uintmax_t uintptr
Represent a pointer or a handle.
Definition: types.h:168
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition: types.h:128
int_least16_t int16
Represents a 16-bit signed integer.
Definition: types.h:66
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:74
char32_t char32
Represents a 32-bit unicode character.
Definition: types.h:50
__ulong__ ulong
Represents a 32-bit or 64-bit unsigned integer.
Definition: types.h:176
uint_least64_t uint64
Represents a 64-bit unsigned integer.
Definition: types.h:160
char8_t char8
Represents a 8-bit unicode character.
Definition: types.h:34
int_least64_t int64
Represents a 64-bit signed integer.
Definition: types.h:82
uint_least8_t byte
Represents a 8-bit unsigned integer.
Definition: types.h:26
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition: types.h:152
char16_t char16
Represents a 16-bit unicode character.
Definition: types.h:42
size_t size
Represents a size of any object in bytes.
Definition: types.h:120
wchar_t wchar
Represents a wide character.
Definition: types.h:185