Table of Contents

Class SpecCompatibility

Namespace
EncDotNet.S100.Core
Assembly
EncDotNet.S100.Core.dll

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

declared SpecVersion
catalogue SpecVersion

Returns

SpecMatchKind

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

spec SpecRef

The spec being declared by the dataset (or otherwise requested).

catalogue CatalogueRef

The catalogue we have available.

policy SpecMatchPolicy

The match policy — see SpecMatchPolicy.

Returns

bool