rodecomp/Recovered/jsoncons/include/jsoncons_ext/jsonschema/schema.hpp
ragnarok-clanker 9b9c369f0c Move exe-only code to Recovered/ and rebuild virtualised PakAuxiliary::Extract
Recovered/ holds the code linked only into the standalone exe (scripts/exe/build_exe.py), outside the Clank source dirs:
- jsoncons/ and nProtect/ moved from scripts/exe/; GameGuard stand-in follows main's renamed entry points.
- GPak/PakAuxiliary.cpp: Extract (virtualised in every build; 02-19 jumps out at 0x0065861E) rebuilt from the open GRF Editor decoder, after the visible 02-19 prologue; inline key and kRO keys 1-4. Apply traps (unreachable in 02-19).
- GGHash/GGHash.cpp: CGGHash::Load/Check/VerifyHash trap (RagHash.dat check unreachable in 02-19).
The whole client links: 984 units, 0 unresolved.
2026-11-06 19:33:10 +01:00

55 lines
1.9 KiB
C++

// Copyright 2013-2023 Daniel Parker
// Distributed under the Boost license, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See https://github.com/danielaparker/jsoncons for latest version
#ifndef JSONCONS_JSONSCHEMA_SCHEMA_HPP
#define JSONCONS_JSONSCHEMA_SCHEMA_HPP
#include <jsoncons/config/jsoncons_config.hpp>
#include <jsoncons/uri.hpp>
#include <jsoncons/json.hpp>
#include <jsoncons_ext/jsonpointer/jsonpointer.hpp>
#include <jsoncons_ext/jsonschema/jsonschema_error.hpp>
#include <jsoncons_ext/jsonschema/schema_location.hpp>
#include <jsoncons_ext/jsonschema/keyword_validator.hpp>
namespace jsoncons {
namespace jsonschema {
template <class Json>
class json_schema
{
using validator_type = typename std::unique_ptr<keyword_validator<Json>>;
std::vector<validator_type> subschemas_;
validator_type root_;
public:
json_schema(std::vector<validator_type>&& subschemas, validator_type&& root)
: subschemas_(std::move(subschemas)), root_(std::move(root))
{
if (root_ == nullptr)
JSONCONS_THROW(schema_error("There is no root schema to validate an instance against"));
}
json_schema(const json_schema&) = delete;
json_schema(json_schema&&) = default;
json_schema& operator=(const json_schema&) = delete;
json_schema& operator=(json_schema&&) = default;
void validate(const Json& instance,
const jsonpointer::json_pointer& instance_location,
error_reporter& reporter,
Json& patch) const
{
JSONCONS_ASSERT(root_ != nullptr);
root_->validate(instance, instance_location, reporter, patch);
}
};
} // namespace jsonschema
} // namespace jsoncons
#endif // JSONCONS_JSONSCHEMA_SCHEMA_HPP