28 #include "Requirement.h"
29 #include "RequirementLoader.h"
77 virtual void Parse(Value json,
const std::string& path)
override
82 auto& head = json.isMember(
"oneOf") ? json[
"oneOf"] : json;
87 reqs_.push_back(std::move(req));
88 reqs_.back()->Parse(val, path);
98 virtual void Validate(
const Value& json,
const std::string& path)
override
103 r->Validate(json, path);
109 PushError(path +
": Input must validate against only one schema");
110 else if(validated == 0)
114 for(
const auto& error : r->GetErrors())
118 for(
const auto& notice : r->GetNotices())
void PushError(const std::string &error)
Add error to list of error messages.
virtual void ClearErrors() override
Clear list of error messages for all Requirements.
virtual void Reset() override
Reset requirement.
RequireList reqs_
List of Requirements.
virtual void ClearErrors()
Clear list of error messages.
std::unique_ptr< Requirement > LoadRequirement(const Value &json)
Load specific requirement.
Requires exactly one of a list of Requirements to hold.
OneOfRequirement()
Constructor.
Helper class to load Requirement.
virtual void Parse(Value json, const std::string &path) override
Parse JSON value to generate Requirement.
virtual void ClearNotices()
Clear list of notice messages.
virtual void Validate(const Value &json, const std::string &path) override
Validate that only one of the Requirements hold.
Requirements on input files.
std::vector< std::unique_ptr< Requirement >> RequireList
List of Requirements.
void PushNotice(const std::string ¬ice)
Add message to list of notices.
virtual void ClearNotices() override
Clear list of notices for all Requirements.