2021-10-22 12:10:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "simdjson/simdjson.h"
|
|
|
|
|
|
|
|
class array_t {
|
|
|
|
private:
|
|
|
|
const simdjson::dom::array m_raw;
|
|
|
|
|
|
|
|
protected:
|
2021-10-23 16:46:59 +00:00
|
|
|
[[nodiscard]] auto raw() const noexcept { return m_raw; }
|
2021-10-22 12:10:23 +00:00
|
|
|
|
|
|
|
public:
|
2021-10-28 15:56:54 +00:00
|
|
|
array_t(simdjson::dom::array input) noexcept;
|
|
|
|
|
2022-01-01 11:12:51 +00:00
|
|
|
[[nodiscard]] auto begin() const noexcept { return raw().begin(); }
|
|
|
|
[[nodiscard]] auto end() const noexcept { return raw().end(); }
|
|
|
|
[[nodiscard]] auto size() const noexcept { return raw().size(); }
|
2021-10-28 15:56:54 +00:00
|
|
|
|
|
|
|
[[nodiscard]] auto at(size_t idx) const noexcept { return raw().at(idx); }
|
2021-10-23 16:46:59 +00:00
|
|
|
[[nodiscard]] auto operator[](size_t idx) const noexcept { return at(idx); }
|
2021-10-28 15:56:54 +00:00
|
|
|
|
|
|
|
[[nodiscard]] auto integer_at(size_t idx) const noexcept { return at(idx).get_int64(); }
|
2021-10-22 12:10:23 +00:00
|
|
|
};
|