60 readJson(
const std::span<const std::byte>& data, T& handler) {
63 result.
value.emplace();
65 FinalJsonHandler finalHandler(result.
warnings);
66 handler.reset(&finalHandler, &result.
value.value());
68 JsonReader::internalRead(
75 if (!result.
errors.empty()) {
97 readJson(
const rapidjson::Value& jsonValue, T& handler) {
100 result.
value.emplace();
102 FinalJsonHandler finalHandler(result.
warnings);
103 handler.reset(&finalHandler, &result.
value.value());
105 JsonReader::internalRead(
112 if (!result.
errors.empty()) {
113 result.
value.reset();
122 FinalJsonHandler(std::vector<std::string>& warnings);
123 virtual void reportWarning(
124 const std::string& warning,
125 std::vector<std::string>&& context)
override;
126 void setInputStream(rapidjson::MemoryStream* pInputStream)
noexcept;
129 std::vector<std::string>& _warnings;
130 rapidjson::MemoryStream* _pInputStream;
133 static void internalRead(
134 const std::span<const std::byte>& data,
135 IJsonHandler& handler,
136 FinalJsonHandler& finalHandler,
137 std::vector<std::string>& errors,
138 std::vector<std::string>& warnings);
140 static void internalRead(
141 const rapidjson::Value& jsonValue,
142 IJsonHandler& handler,
143 FinalJsonHandler& finalHandler,
144 std::vector<std::string>& errors,
145 std::vector<std::string>& warnings);