@@ -1,14 +1,15 @@
|
||||
#include <vamp_pico/http_client.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <charconv>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <system_error>
|
||||
|
||||
#include <vamp_pico/http_client.hpp>
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
auto copy_value(std::string_view value, std::char_t* output, std::size_t capacity) -> void {
|
||||
auto copy_value(std::string_view value, std::char_t *output, std::size_t capacity) -> void {
|
||||
if (capacity == 0U) {
|
||||
return;
|
||||
}
|
||||
@@ -17,13 +18,13 @@ auto copy_value(std::string_view value, std::char_t* output, std::size_t capacit
|
||||
output[count] = '\0';
|
||||
}
|
||||
|
||||
auto parse_uint(std::string_view value, std::uint32_t& output) -> std::bool_t {
|
||||
auto parse_uint(std::string_view value, std::uint32_t &output) -> std::bool_t {
|
||||
if (value.empty()) {
|
||||
return false;
|
||||
}
|
||||
auto parsed = std::uint64_t{};
|
||||
auto const* begin = value.data();
|
||||
auto const* end = value.data() + value.size();
|
||||
auto const *begin = value.data();
|
||||
auto const *end = value.data() + value.size();
|
||||
auto result = std::from_chars(begin, end, parsed, 10);
|
||||
if (result.ec != std::errc{} || result.ptr != end || parsed > std::numeric_limits<std::uint32_t>::max()) {
|
||||
return false;
|
||||
@@ -41,7 +42,7 @@ auto strip_cr(std::string_view line) -> std::string_view {
|
||||
|
||||
}
|
||||
|
||||
auto vamp_pico::parse_remote_display_body(std::string_view body, vamp_pico::remote_display_state& state) -> std::bool_t {
|
||||
auto vamp_pico::parse_remote_display_body(std::string_view body, vamp_pico::remote_display_state &state) -> std::bool_t {
|
||||
auto parsed = vamp_pico::remote_display_state{};
|
||||
auto cursor = std::size_t{};
|
||||
while (cursor <= body.size()) {
|
||||
|
||||
Reference in New Issue
Block a user