EightBit/M6502/HarteTest_6502/json_t.h
Adrian Conlon 5686906583 Add nodiscard attributes, where needed
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
2021-10-11 10:43:33 +01:00

26 lines
1.1 KiB
C++

#pragma once
#include <cstdint>
#include <string>
#include <boost/json.hpp>
class json_t {
protected:
[[nodiscard]] static const boost::json::value& get_value(const boost::json::object& object, std::string key);
[[nodiscard]] static int64_t get_int64(const boost::json::value& value);
[[nodiscard]] static uint16_t get_uint16(const boost::json::value& value);
[[nodiscard]] static uint8_t get_uint8(const boost::json::value& value);
[[nodiscard]] static int64_t get_int64(const boost::json::object& object, std::string key);
[[nodiscard]] static uint16_t get_uint16(const boost::json::object& object, std::string key);
[[nodiscard]] static uint8_t get_uint8(const boost::json::object& object, std::string key);
[[nodiscard]] static const boost::json::array& get_array(const boost::json::value& value);
[[nodiscard]] static const boost::json::array& get_array(const boost::json::object& object, std::string key);
[[nodiscard]] static const boost::json::string& get_string(const boost::json::value& value);
[[nodiscard]] static const boost::json::string& get_string(const boost::json::object& object, std::string key);
};