mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-11-17 04:09:14 +00:00
04a9ffdcda
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
23 lines
679 B
C++
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(); }
|
|
};
|