1 #ifndef ARBITER_REQUIREMENT_H 2 #define ARBITER_REQUIREMENT_H 8 #include <arbiter/Value.h> 15 struct ArbiterSelectedVersion;
36 } ArbiterRequirementStrictness;
47 typedef bool (*ArbiterRequirementPredicate)(
const struct ArbiterSelectedVersion *version,
const void *context);
ArbiterRequirement * ArbiterCreateRequirementUnversioned(ArbiterUserValue metadata)
Creates a requirement which only matches against ArbiterSelectedVersions that have metadata equal to ...
ArbiterRequirement * ArbiterCreateRequirementAtLeast(const struct ArbiterSemanticVersion *version)
Creates a requirement which will match versions not less than the specified version.
ArbiterRequirement * ArbiterCreateRequirementAny(void)
Creates a requirement which will match any version.
bool operator>=(const ArbiterSemanticVersion &other) const noexcept
bool ArbiterRequirementSatisfiedBy(const ArbiterRequirement *requirement, const struct ArbiterSelectedVersion *version)
Determines whether the given requirement is satisfied by the given version.
ArbiterRequirement * ArbiterCreateRequirementCompound(const ArbiterRequirement *const *requirements, size_t count)
Creates a compound requirement that evaluates each of a list of requirements.
ArbiterRequirement * ArbiterCreateRequirementCompatibleWith(const struct ArbiterSemanticVersion *version, ArbiterRequirementStrictness strictness)
Creates a requirement which will match versions that are "compatible with" the given version...
virtual std::unique_ptr< ArbiterRequirement > intersect(const ArbiterRequirement &rhs) const =0
Attempts to create a requirement which expresses the intersection of this requirement and the given o...
According to SemVer, technically all 0.y.z releases can break backwards compatibility, meaning that minor and patch versions have to match exactly in order to be "compatible.".
ArbiterRequirement * ArbiterCreateRequirementCustom(ArbiterRequirementPredicate predicate, ArbiterUserContext context)
Creates a requirement which will evaluate a custom predicate whenever a specific version is checked a...
ArbiterRequirement * ArbiterCreateRequirementExactly(const struct ArbiterSemanticVersion *version)
Creates a requirement which will only match the specified version, including any prerelease version a...
ArbiterRequirement * ArbiterCreateRequirementPrioritized(const ArbiterRequirement *baseRequirement, int priorityIndex)
Creates a requirement with a custom priority, changing how the base requirement intersects with other...
int ArbiterRequirementPriority(const ArbiterRequirement *requirement)
Returns the priority of the given requirement.
Determine compatibility according to a strict interpretation of SemVer.