28 #include "Requirement.h"
29 #include "RequirementLoader.h"
40 std::unique_ptr<Requirement>
req_;
78 virtual void Parse(Value json,
const std::string& path)
override
83 auto& head = json.isMember(
"not") ? json[
"not"] : json;
85 req_->Parse(head, path);
97 virtual void Validate(
const Value& json,
const std::string& path)
override
99 req_->Validate(json, path);
100 if(!
req_->HasErrors())
101 PushError(path +
": Value must not validate against requirement.");
Requires a given Requirement to fail.
virtual void Parse(Value json, const std::string &path) override
Parse JSON value and generate Requirement to be negated.
virtual void Reset() override
Reset Requirement.
NotRequirement()
Constructor.
virtual void Validate(const Value &json, const std::string &path) override
Validate that JSON value fails the given Requirement.
virtual void ClearNotices() override
Clear list of notices.
std::unique_ptr< Requirement > req_
Requirement to negate.
virtual void ClearErrors() override
Clear list of error messages.
Helper class to load Requirement.
std::unique_ptr< Requirement > LoadRequirement(const Value &json)
Load specific requirement.
Requirements on input files.
virtual void ClearNotices()
Clear list of notice messages.
virtual void ClearErrors()
Clear list of error messages.
void PushError(const std::string &error)
Add error to list of error messages.