1
0
mirror of synced 2025-01-19 01:24:15 +01:00

lang: Added translation to long double inspector line

This commit is contained in:
WerWolv 2022-02-15 21:53:39 +01:00
parent d6b887b7db
commit adfaa95149
6 changed files with 9 additions and 4 deletions

View File

@ -24,7 +24,7 @@ namespace hex::plugin::builtin {
};
template<std::integral T>
requires(sizeof(T) <= sizeof(u64)) static std::vector<u8> stringToUnsigned(const std::string &value, std::endian endian) {
static std::vector<u8> stringToUnsigned(const std::string &value, std::endian endian) requires(sizeof(T) <= sizeof(u64)) {
u64 result = std::strtoull(value.c_str(), nullptr, 0);
if (result > std::numeric_limits<T>::max()) return {};
@ -38,7 +38,7 @@ namespace hex::plugin::builtin {
}
template<std::integral T>
requires(sizeof(T) <= sizeof(u64)) static std::vector<u8> stringToSigned(const std::string &value, std::endian endian) {
static std::vector<u8> stringToSigned(const std::string &value, std::endian endian) requires(sizeof(T) <= sizeof(u64)) {
i64 result = std::strtoull(value.c_str(), nullptr, 0);
if (result > std::numeric_limits<T>::max() || result < std::numeric_limits<T>::min()) return {};
@ -52,7 +52,7 @@ namespace hex::plugin::builtin {
}
template<std::floating_point T>
requires(sizeof(T) <= sizeof(long double)) static std::vector<u8> stringToFloat(const std::string &value, std::endian endian) {
static std::vector<u8> stringToFloat(const std::string &value, std::endian endian) requires(sizeof(T) <= sizeof(long double)) {
auto result = std::strtold(value.c_str(), nullptr);
std::vector<u8> bytes(sizeof(T), 0x00);
@ -65,7 +65,7 @@ namespace hex::plugin::builtin {
}
template<std::integral T>
requires(sizeof(T) <= sizeof(u64)) static std::vector<u8> stringToInteger(const std::string &value, std::endian endian) {
static std::vector<u8> stringToInteger(const std::string &value, std::endian endian) requires(sizeof(T) <= sizeof(u64)) {
if constexpr (std::is_unsigned_v<T>)
return stringToUnsigned<T>(value, endian);
else if constexpr (std::is_signed_v<T>)

View File

@ -406,6 +406,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.inspector.float16", "half float (16 bit)" },
{ "hex.builtin.inspector.float", "float (32 bit)" },
{ "hex.builtin.inspector.double", "double (64 bit)" },
{ "hex.builtin.inspector.long_double", "long double (128 bit)" },
{ "hex.builtin.inspector.ascii", "ASCII Zeichen" },
{ "hex.builtin.inspector.wide", "Wide Zeichen" },
{ "hex.builtin.inspector.utf8", "UTF-8 code point" },

View File

@ -411,6 +411,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.inspector.float16", "half float (16 bit)" },
{ "hex.builtin.inspector.float", "float (32 bit)" },
{ "hex.builtin.inspector.double", "double (64 bit)" },
{ "hex.builtin.inspector.long_double", "long double (128 bit)" },
{ "hex.builtin.inspector.ascii", "ASCII Character" },
{ "hex.builtin.inspector.wide", "Wide Character" },
{ "hex.builtin.inspector.utf8", "UTF-8 code point" },

View File

@ -402,6 +402,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.inspector.float16", "half float (16 bit)" },
{ "hex.builtin.inspector.float", "float (32 bit)" },
{ "hex.builtin.inspector.double", "double (64 bit)" },
{ "hex.builtin.inspector.long_double", "long double (128 bit)" },
{ "hex.builtin.inspector.ascii", "ASCII Character" },
{ "hex.builtin.inspector.wide", "Wide Character" },
{ "hex.builtin.inspector.utf8", "UTF-8 code point" },

View File

@ -410,6 +410,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.inspector.float16", "half float (16 bit)" },
{ "hex.builtin.inspector.float", "float (32 bit)" },
{ "hex.builtin.inspector.double", "double (64 bit)" },
{ "hex.builtin.inspector.long_double", "long double (128 bit)" },
{ "hex.builtin.inspector.ascii", "ASCII文字" },
{ "hex.builtin.inspector.wide", "Wide Character" },
{ "hex.builtin.inspector.utf8", "UTF-8 code point" },

View File

@ -404,6 +404,7 @@ namespace hex::plugin::builtin {
{ "hex.builtin.inspector.float16", "半浮点(16位)" },
{ "hex.builtin.inspector.float", "float(32位单精度浮点)" },
{ "hex.builtin.inspector.double", "double(64位双精度浮点)" },
{ "hex.builtin.inspector.long_double", "long double(128位双精度浮点)" },
{ "hex.builtin.inspector.ascii", "ASCII字符" },
{ "hex.builtin.inspector.wide", "宽字符" },
{ "hex.builtin.inspector.utf8", "UTF-8代码点" },