51 static constexpr uint32 __endian_value__ = 0x01020304;
52 static constexpr xtd::byte __endian_query__ =
static_cast<const xtd::byte&
>(__endian_value__);
73 static constexpr bool is_big_endian = __endian_query__ == 0x01u;
80 static constexpr bool is_little_endian = __endian_query__ == 0x04u;
87 static constexpr endian endianness = is_little_endian ? endian::little : endian::big;
108 static std::vector<xtd::byte>
get_bytes(
bool value)
noexcept;
116 static std::vector<xtd::byte>
get_bytes(
char value)
noexcept;
148 static std::vector<xtd::byte>
get_bytes(
double value)
noexcept;
185 static std::vector<xtd::byte>
get_bytes(
float value)
noexcept;
217 static std::vector<xtd::byte> get_bytes(
slong value)
noexcept;
218 static std::vector<xtd::byte> get_bytes(
xtd::ulong value)
noexcept;
248 static bool to_boolean(
const std::vector<xtd::byte>& value,
size_t start_index);
258 static char32 to_char(
const std::vector<xtd::byte>& value,
size_t start_index);
268 static double to_double(
const std::vector<xtd::byte>& value,
size_t start_index);
278 static int16 to_int16(
const std::vector<xtd::byte>& value,
size_t start_index);
288 static int32 to_int32(
const std::vector<xtd::byte>& value,
size_t start_index);
298 static int64 to_int64(
const std::vector<xtd::byte>& value,
size_t start_index);
308 static float to_single(
const std::vector<xtd::byte>& value,
size_t start_index);
Converts base data types to an std::vector of bytes, and an std::vector of bytes to base data types.
Definition bit_converter.h:49
static float int32_bits_to_single(int32 value) noexcept
Converts the specified 32-bit signed integer to a single-precision floating point number.
static int32 to_int32(const std::vector< xtd::byte > &value, size_t start_index)
Returns a 32-bit signed integer converted from two bytes at a specified position in a xtd::byte std::...
static std::vector< xtd::byte > get_bytes(uint16 value) noexcept
Returns the specified uint16 value as an std::vector of bytes.
static std::vector< xtd::byte > get_bytes(wchar value) noexcept
Returns the specified Char value as an std::vector of bytes.
static std::vector< xtd::byte > get_bytes(int16 value) noexcept
Returns the specified int16 value as an std::vector of bytes.
static float to_single(const std::vector< xtd::byte > &value, size_t start_index)
Returns a single-precision floating point number converted from eight bytes at a specified position i...
static std::vector< xtd::byte > get_bytes(uint32 value) noexcept
Returns the specified uint32 value as an std::vector of bytes.
static int64 double_to_int64_bits(double value) noexcept
Converts the specified double-precision floating point number to a 64-bit signed integer.
static int16 to_int16(const std::vector< xtd::byte > &value, size_t start_index)
Returns a 16-bit signed integer converted from two bytes at a specified position in a xtd::byte std::...
static uint16 to_uint16(const std::vector< xtd::byte > &value, size_t start_index)
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a xtd::byte std...
static bool to_boolean(const std::vector< xtd::byte > &value, size_t start_index)
Returns a Boolean value converted from one xtd::byte at a specified position in a xtd::byte std::vect...
static std::vector< xtd::byte > get_bytes(char value) noexcept
Returns the specified Char value as an std::vector of bytes.
static std::vector< xtd::byte > get_bytes(xtd::byte value) noexcept
Returns the specified xtd::byte value as an std::vector of bytes.
static xtd::ustring to_string(const std::vector< xtd::byte > &value, size_t start_index, size_t length)
Converts the numeric value of each element of a specified sub std::vector of bytes to its equivalent ...
static std::vector< xtd::byte > get_bytes(sbyte value) noexcept
Returns the specified xtd::byte value as an std::vector of bytes.
endian
Represents the xtd::byte order ("endianness") in which data is stored in this computer architecture.
Definition bit_converter.h:57
@ little
Represnets "Little-endian" order.
@ big
Represnets "Big-endian" order.
static xtd::ustring to_string(const std::vector< xtd::byte > &value)
Converts the numeric value of each element of a specified std::vector of bytes to its equivalent hexa...
static int32 single_to_int32_bits(float value) noexcept
Converts the specified single-precision floating point number to a 32-bit signed integer.
static uint64 to_uint64(const std::vector< xtd::byte > &value, size_t start_index)
Returns a 64-bit unsigned integer converted from two bytes at a specified position in a xtd::byte std...
static std::vector< xtd::byte > get_bytes(int32 value) noexcept
Returns the specified int32 value as an std::vector of bytes.
static std::vector< xtd::byte > get_bytes(bool value) noexcept
Returns the specified Boolean value as an std::vector of bytes.
static double int64_bits_to_double(int64 value) noexcept
Converts the specified 64-bit signed integer to a double-precision floating point number.
static xtd::ustring to_string(const std::vector< xtd::byte > &value, size_t start_index)
Converts the numeric value of each element of a specified sub std::vector of bytes to its equivalent ...
static uint32 to_uint32(const std::vector< xtd::byte > &value, size_t start_index)
Returns a 32-bit signed integer converted from two bytes at a specified position in a xtd::byte std::...
static int64 to_int64(const std::vector< xtd::byte > &value, size_t start_index)
Returns a 64-bit signed integer converted from two bytes at a specified position in a xtd::byte std::...
static std::vector< xtd::byte > get_bytes(char16 value) noexcept
Returns the specified Char value as an std::vector of bytes.
static char32 to_char(const std::vector< xtd::byte > &value, size_t start_index)
Returns a char32 converted from two bytes at a specified position in a xtd::byte std::vector.
static std::vector< xtd::byte > get_bytes(double value) noexcept
Returns the specified double value as an std::vector of bytes.
static std::vector< xtd::byte > get_bytes(char32 value) noexcept
Returns the specified Char value as an std::vector of bytes.
static std::vector< xtd::byte > get_bytes(int64 value) noexcept
Returns the specified int64 value as an std::vector of bytes.
static std::vector< xtd::byte > get_bytes(uint64 value) noexcept
Returns the specified uint64 value as an std::vector of bytes.
static double to_double(const std::vector< xtd::byte > &value, size_t start_index)
Returns a double-precision floating point number converted from eight bytes at a specified position i...
static std::vector< xtd::byte > get_bytes(float value) noexcept
Returns the specified single value as an std::vector of bytes.
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Contains core_export_ keyword.
Contains enum_ and enum_ut_ keywords.
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.h:37
#define core_export_
Define shared library export.
Definition core_export.h:13
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
__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::vector< std::pair< enum_t, xtd::ustring > > enum_collection
Represents a pair of an enum_t value and a string of an enum of type enum_t.
Definition enum_collection.h:19
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::static_object class.
Provides the registration struct for enumerations.
Definition enum_register.h:36
Contains xtd fundamental types.