mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-22 12:30:44 +00:00
b70f24a581
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
29 lines
737 B
C++
29 lines
737 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "simdjson/simdjson.h"
|
|
|
|
class opcode_test_suite_t final {
|
|
private:
|
|
// N.B.
|
|
// The parser must be kept for the lifetime of any parsed data.
|
|
// Therefore, it can only be used for one document at a time.
|
|
static simdjson::dom::parser m_parser;
|
|
|
|
[[nodiscard]] static std::string read(std::string path);
|
|
|
|
std::string m_path;
|
|
std::string m_contents;
|
|
simdjson::dom::element m_raw;
|
|
|
|
public:
|
|
opcode_test_suite_t(std::string path);
|
|
|
|
[[nodiscard]] constexpr const auto& path() const noexcept { return m_path; }
|
|
[[nodiscard]] const auto raw() const noexcept { return m_raw; }
|
|
|
|
void load(); // Reads into contents
|
|
void parse(); // Parse the contents
|
|
};
|