| 180 | content_checker &content_check() { return content_check_; } |
| 181 | |
| 182 | void insert(const json_uri &uri, const std::shared_ptr<schema> &s) |
| 183 | { |
| 184 | auto &file = get_or_create_file(uri.location()); |
| 185 | auto sch = file.schemas.lower_bound(uri.fragment()); |
| 186 | if (sch != file.schemas.end() && !(file.schemas.key_comp()(uri.fragment(), sch->first))) { |
| 187 | throw std::invalid_argument("schema with " + uri.to_string() + " already inserted"); |
| 188 | return; |
| 189 | } |
| 190 | |
| 191 | file.schemas.insert({uri.fragment(), s}); |
| 192 | |
| 193 | // was someone referencing this newly inserted schema? |
| 194 | auto unresolved = file.unresolved.find(uri.fragment()); |
| 195 | if (unresolved != file.unresolved.end()) { |
| 196 | unresolved->second->set_target(s); |
| 197 | file.unresolved.erase(unresolved); |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | void insert_unknown_keyword(const json_uri &uri, const std::string &key, json &value) |
| 202 | { |
no test coverage detected