mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-23 00:29:47 +00:00
f3f6452119
1/2 speed, compared to boost.json Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
29 lines
1.2 KiB
C++
29 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#ifdef USE_BOOST_JSON
|
|
# include <cstdint>
|
|
# include <string>
|
|
# include <boost/json.hpp>
|
|
#endif
|
|
|
|
class json_t {
|
|
#ifdef USE_BOOST_JSON
|
|
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);
|
|
#endif
|
|
};
|