Class SpecCompatibility
Helpers for matching a requested SpecRef against an available CatalogueRef. The match policy is supplied by the caller — providers themselves do not apply hidden fallback rules.
public static class SpecCompatibility
- Inheritance
-
SpecCompatibility
- Inherited Members
Methods
Classify(SpecVersion, SpecVersion)
Classifies the relationship between the version a dataset declares
(declared) and the version a catalogue we resolved
for it carries (catalogue). Useful for surfacing a
structured warning when the two diverge.
public static SpecMatchKind Classify(SpecVersion declared, SpecVersion catalogue)
Parameters
declaredSpecVersioncatalogueSpecVersion
Returns
Remarks
Returns Exact when the two versions are
equal; CatalogueNewerCompatible when the
catalogue is on the same major and at least the same minor (a S-100
Part 2 §6 backward-compatible read); CatalogueOlder
when the catalogue is on the same major but a lower minor (the
dataset may use features the catalogue doesn't know about); and
MajorDivergence when the two are on
different majors (incompatible — decoding may misinterpret data).
A default(SpecVersion) on either side falls through to
Unknown.
IsMatch(SpecRef, CatalogueRef, SpecMatchPolicy)
Returns true when catalogue satisfies
spec under the given policy.
public static bool IsMatch(SpecRef spec, CatalogueRef catalogue, SpecMatchPolicy policy)
Parameters
specSpecRefThe spec being declared by the dataset (or otherwise requested).
catalogueCatalogueRefThe catalogue we have available.
policySpecMatchPolicyThe match policy — see SpecMatchPolicy.