2021-10-19 08:28:13 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-10-24 10:42:43 +00:00
|
|
|
#include <cstdint>
|
|
|
|
|
2021-10-20 20:44:43 +00:00
|
|
|
#include "simdjson/simdjson.h"
|
2021-10-19 08:28:13 +00:00
|
|
|
|
2021-10-22 12:10:23 +00:00
|
|
|
#include "array_t.h"
|
2021-10-21 21:03:07 +00:00
|
|
|
|
2021-10-22 12:10:23 +00:00
|
|
|
class byte_t : public array_t {
|
2021-10-19 08:28:13 +00:00
|
|
|
public:
|
|
|
|
byte_t(simdjson::dom::array input) noexcept;
|
|
|
|
|
2024-01-01 23:25:32 +00:00
|
|
|
[[nodiscard]] auto address_at(size_t idx) const noexcept { return uint16_t(integer_at(idx)); }
|
|
|
|
[[nodiscard]] auto byte_at(size_t idx) const noexcept { return uint8_t(integer_at(idx)); }
|
2021-10-28 15:56:54 +00:00
|
|
|
|
2021-10-21 21:03:07 +00:00
|
|
|
[[nodiscard]] auto address() const noexcept { return address_at(0); }
|
|
|
|
[[nodiscard]] auto value() const noexcept { return byte_at(1); }
|
2021-10-19 08:28:13 +00:00
|
|
|
};
|