EightBit/M6502/HarteTest_6502/element_t.h
Adrian Conlon 04a9ffdcda Some visibility refactoring.
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
2021-10-28 16:56:54 +01:00

23 lines
679 B
C++

#pragma once
#include <string_view>
#include "simdjson/simdjson.h"
class element_t {
private:
simdjson::dom::element m_raw;
protected:
[[nodiscard]] auto raw() const noexcept { return m_raw; }
public:
element_t() noexcept;
element_t(simdjson::dom::element input) noexcept;
[[nodiscard]] auto at(std::string_view key) const noexcept { return raw()[key]; }
[[nodiscard]] auto operator[](std::string_view key) const noexcept { return at(key); }
[[nodiscard]] auto array_at(std::string_view key) const noexcept { return at(key).get_array(); }
[[nodiscard]] auto integer_at(std::string_view key) const noexcept { return at(key).get_int64(); }
};