82 | 392 | } void invoke_fmt<bool>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 39 | { | 55 | 39 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 39 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 33 | T value{}; | 59 | 33 | if constexpr (std::is_same_v<bool, T>) { | 60 | 33 | value = !!data[0]; | 61 | | } else { | 62 | | std::memcpy(&value, data, sizeof(T)); | 63 | | } | 64 | | | 65 | 33 | data += fixed_size; | 66 | 33 | size -= fixed_size; | 67 | | | 68 | 33 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 33 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 33 | try { | 75 | 33 | std::vector<char> buf(2000); | 76 | 33 | [[maybe_unused]] auto ignored = | 77 | 33 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 33 | format_string, | 79 | 33 | std::make_format_args(value)); | 80 | 33 | } catch (std::exception&) { | 81 | 22 | } | 82 | 33 | } |
void invoke_fmt<char>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 29 | { | 55 | 29 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 29 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 23 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 23 | } else { | 62 | 23 | std::memcpy(&value, data, sizeof(T)); | 63 | 23 | } | 64 | | | 65 | 23 | data += fixed_size; | 66 | 23 | size -= fixed_size; | 67 | | | 68 | 23 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 23 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 23 | try { | 75 | 23 | std::vector<char> buf(2000); | 76 | 23 | [[maybe_unused]] auto ignored = | 77 | 23 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 23 | format_string, | 79 | 23 | std::make_format_args(value)); | 80 | 23 | } catch (std::exception&) { | 81 | 18 | } | 82 | 23 | } |
void invoke_fmt<unsigned char>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 29 | { | 55 | 29 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 29 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 23 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 23 | } else { | 62 | 23 | std::memcpy(&value, data, sizeof(T)); | 63 | 23 | } | 64 | | | 65 | 23 | data += fixed_size; | 66 | 23 | size -= fixed_size; | 67 | | | 68 | 23 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 23 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 23 | try { | 75 | 23 | std::vector<char> buf(2000); | 76 | 23 | [[maybe_unused]] auto ignored = | 77 | 23 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 23 | format_string, | 79 | 23 | std::make_format_args(value)); | 80 | 23 | } catch (std::exception&) { | 81 | 17 | } | 82 | 23 | } |
void invoke_fmt<signed char>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 29 | { | 55 | 29 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 29 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 23 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 23 | } else { | 62 | 23 | std::memcpy(&value, data, sizeof(T)); | 63 | 23 | } | 64 | | | 65 | 23 | data += fixed_size; | 66 | 23 | size -= fixed_size; | 67 | | | 68 | 23 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 23 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 23 | try { | 75 | 23 | std::vector<char> buf(2000); | 76 | 23 | [[maybe_unused]] auto ignored = | 77 | 23 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 23 | format_string, | 79 | 23 | std::make_format_args(value)); | 80 | 23 | } catch (std::exception&) { | 81 | 16 | } | 82 | 23 | } |
void invoke_fmt<short>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 28 | { | 55 | 28 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 28 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 22 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 22 | } else { | 62 | 22 | std::memcpy(&value, data, sizeof(T)); | 63 | 22 | } | 64 | | | 65 | 22 | data += fixed_size; | 66 | 22 | size -= fixed_size; | 67 | | | 68 | 22 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 22 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 22 | try { | 75 | 22 | std::vector<char> buf(2000); | 76 | 22 | [[maybe_unused]] auto ignored = | 77 | 22 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 22 | format_string, | 79 | 22 | std::make_format_args(value)); | 80 | 22 | } catch (std::exception&) { | 81 | 17 | } | 82 | 22 | } |
void invoke_fmt<unsigned short>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 29 | { | 55 | 29 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 29 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 23 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 23 | } else { | 62 | 23 | std::memcpy(&value, data, sizeof(T)); | 63 | 23 | } | 64 | | | 65 | 23 | data += fixed_size; | 66 | 23 | size -= fixed_size; | 67 | | | 68 | 23 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 23 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 23 | try { | 75 | 23 | std::vector<char> buf(2000); | 76 | 23 | [[maybe_unused]] auto ignored = | 77 | 23 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 23 | format_string, | 79 | 23 | std::make_format_args(value)); | 80 | 23 | } catch (std::exception&) { | 81 | 17 | } | 82 | 23 | } |
void invoke_fmt<int>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 31 | { | 55 | 31 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 31 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 25 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 25 | } else { | 62 | 25 | std::memcpy(&value, data, sizeof(T)); | 63 | 25 | } | 64 | | | 65 | 25 | data += fixed_size; | 66 | 25 | size -= fixed_size; | 67 | | | 68 | 25 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 25 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 25 | try { | 75 | 25 | std::vector<char> buf(2000); | 76 | 25 | [[maybe_unused]] auto ignored = | 77 | 25 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 25 | format_string, | 79 | 25 | std::make_format_args(value)); | 80 | 25 | } catch (std::exception&) { | 81 | 19 | } | 82 | 25 | } |
void invoke_fmt<unsigned int>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 28 | { | 55 | 28 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 28 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 22 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 22 | } else { | 62 | 22 | std::memcpy(&value, data, sizeof(T)); | 63 | 22 | } | 64 | | | 65 | 22 | data += fixed_size; | 66 | 22 | size -= fixed_size; | 67 | | | 68 | 22 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 22 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 22 | try { | 75 | 22 | std::vector<char> buf(2000); | 76 | 22 | [[maybe_unused]] auto ignored = | 77 | 22 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 22 | format_string, | 79 | 22 | std::make_format_args(value)); | 80 | 22 | } catch (std::exception&) { | 81 | 18 | } | 82 | 22 | } |
void invoke_fmt<long>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 34 | { | 55 | 34 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 34 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 28 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 28 | } else { | 62 | 28 | std::memcpy(&value, data, sizeof(T)); | 63 | 28 | } | 64 | | | 65 | 28 | data += fixed_size; | 66 | 28 | size -= fixed_size; | 67 | | | 68 | 28 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 28 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 28 | try { | 75 | 28 | std::vector<char> buf(2000); | 76 | 28 | [[maybe_unused]] auto ignored = | 77 | 28 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 28 | format_string, | 79 | 28 | std::make_format_args(value)); | 80 | 28 | } catch (std::exception&) { | 81 | 17 | } | 82 | 28 | } |
void invoke_fmt<unsigned long>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 31 | { | 55 | 31 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 31 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 25 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 25 | } else { | 62 | 25 | std::memcpy(&value, data, sizeof(T)); | 63 | 25 | } | 64 | | | 65 | 25 | data += fixed_size; | 66 | 25 | size -= fixed_size; | 67 | | | 68 | 25 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 25 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 25 | try { | 75 | 25 | std::vector<char> buf(2000); | 76 | 25 | [[maybe_unused]] auto ignored = | 77 | 25 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 25 | format_string, | 79 | 25 | std::make_format_args(value)); | 80 | 25 | } catch (std::exception&) { | 81 | 18 | } | 82 | 25 | } |
void invoke_fmt<float>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 29 | { | 55 | 29 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 29 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 23 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 23 | } else { | 62 | 23 | std::memcpy(&value, data, sizeof(T)); | 63 | 23 | } | 64 | | | 65 | 23 | data += fixed_size; | 66 | 23 | size -= fixed_size; | 67 | | | 68 | 23 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 23 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 23 | try { | 75 | 23 | std::vector<char> buf(2000); | 76 | 23 | [[maybe_unused]] auto ignored = | 77 | 23 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 23 | format_string, | 79 | 23 | std::make_format_args(value)); | 80 | 23 | } catch (std::exception&) { | 81 | 16 | } | 82 | 23 | } |
void invoke_fmt<double>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 31 | { | 55 | 31 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 31 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 25 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 25 | } else { | 62 | 25 | std::memcpy(&value, data, sizeof(T)); | 63 | 25 | } | 64 | | | 65 | 25 | data += fixed_size; | 66 | 25 | size -= fixed_size; | 67 | | | 68 | 25 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 25 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 25 | try { | 75 | 25 | std::vector<char> buf(2000); | 76 | 25 | [[maybe_unused]] auto ignored = | 77 | 25 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 25 | format_string, | 79 | 25 | std::make_format_args(value)); | 80 | 25 | } catch (std::exception&) { | 81 | 17 | } | 82 | 25 | } |
void invoke_fmt<long double>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 36 | { | 55 | 36 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 36 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 30 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 30 | } else { | 62 | 30 | std::memcpy(&value, data, sizeof(T)); | 63 | 30 | } | 64 | | | 65 | 30 | data += fixed_size; | 66 | 30 | size -= fixed_size; | 67 | | | 68 | 30 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 30 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 30 | try { | 75 | 30 | std::vector<char> buf(2000); | 76 | 30 | [[maybe_unused]] auto ignored = | 77 | 30 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 30 | format_string, | 79 | 30 | std::make_format_args(value)); | 80 | 30 | } catch (std::exception&) { | 81 | 22 | } | 82 | 30 | } |
void invoke_fmt<void*>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 27 | { | 55 | 27 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 27 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 21 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 21 | } else { | 62 | 21 | std::memcpy(&value, data, sizeof(T)); | 63 | 21 | } | 64 | | | 65 | 21 | data += fixed_size; | 66 | 21 | size -= fixed_size; | 67 | | | 68 | 21 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 21 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 21 | try { | 75 | 21 | std::vector<char> buf(2000); | 76 | 21 | [[maybe_unused]] auto ignored = | 77 | 21 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 21 | format_string, | 79 | 21 | std::make_format_args(value)); | 80 | 21 | } catch (std::exception&) { | 81 | 17 | } | 82 | 21 | } |
void invoke_fmt<__int128>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 29 | { | 55 | 29 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 29 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 23 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 23 | } else { | 62 | 23 | std::memcpy(&value, data, sizeof(T)); | 63 | 23 | } | 64 | | | 65 | 23 | data += fixed_size; | 66 | 23 | size -= fixed_size; | 67 | | | 68 | 23 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 23 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 23 | try { | 75 | 23 | std::vector<char> buf(2000); | 76 | 23 | [[maybe_unused]] auto ignored = | 77 | 23 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 23 | format_string, | 79 | 23 | std::make_format_args(value)); | 80 | 23 | } catch (std::exception&) { | 81 | 15 | } | 82 | 23 | } |
void invoke_fmt<unsigned __int128>(unsigned char const*, unsigned long) Line | Count | Source | 54 | 29 | { | 55 | 29 | static_assert(sizeof(T) <= fixed_size, "fixed_size is too small"); | 56 | 29 | if (size <= fixed_size) | 57 | 6 | return; | 58 | 23 | T value{}; | 59 | | if constexpr (std::is_same_v<bool, T>) { | 60 | | value = !!data[0]; | 61 | 23 | } else { | 62 | 23 | std::memcpy(&value, data, sizeof(T)); | 63 | 23 | } | 64 | | | 65 | 23 | data += fixed_size; | 66 | 23 | size -= fixed_size; | 67 | | | 68 | 23 | const auto* chardata = reinterpret_cast<const char*>(data); | 69 | | // std::string format_string{ chardata, chardata + size }; | 70 | | | 71 | | // format_string.append(10, '}'); | 72 | 23 | const std::string_view format_string{ chardata, size }; | 73 | | | 74 | 23 | try { | 75 | 23 | std::vector<char> buf(2000); | 76 | 23 | [[maybe_unused]] auto ignored = | 77 | 23 | std::vformat_to(LimitedIterator(buf.data(), buf.size() - 2), | 78 | 23 | format_string, | 79 | 23 | std::make_format_args(value)); | 80 | 23 | } catch (std::exception&) { | 81 | 15 | } | 82 | 23 | } |
|