Struct SpecRef
Identity of a single S-100 product specification edition — the pair
(name, edition) that a dataset declares conformance to (e.g.
S-101 / 1.2.0).
public readonly record struct SpecRef : IEquatable<SpecRef>
- Implements
- Inherited Members
Remarks
Name is normalised to canonical "S-NNN" form by the
constructor. Use Parse(string) for tolerant parsing of the various
representations seen in real-world datasets, exchange-set CATALOG.XML
entries, HDF5 productSpecification attributes, and GML application
namespaces.
SpecRef identifies the product specification a dataset
targets. The version of the Feature or Portrayal Catalogue used to
process that dataset is a separate identity tracked by
CatalogueRef; the two float independently because S-100
product specs and their catalogues advance on different release cadences
(e.g. S-101 product spec at edition 1.2.0 ships with a Feature
Catalogue at version 2.0.0).
Constructors
SpecRef(string, SpecVersion)
Creates a new SpecRef. name is
normalised to "S-NNN" form; FormatException is
thrown if it is not a recognised S-100 product spec name.
public SpecRef(string name, SpecVersion edition)
Parameters
namestringeditionSpecVersion
Properties
Edition
The product specification edition.
public SpecVersion Edition { get; }
Property Value
Name
The product specification short name in canonical "S-NNN" form
(e.g. "S-101", "S-102").
public string Name { get; }
Property Value
Methods
Parse(string)
Parses a SpecRef from one of the following forms:
"S-101/1.2.0"— canonical form (this type's ToString())."S-101@1.2.0"— alternate separator."INT.IHO.S-101.1.2.0"— exchange-set product identifier form.
Casing of the leading S and presence of the dash are tolerated.
public static SpecRef Parse(string s)
Parameters
sstring
Returns
Exceptions
- FormatException
The input does not match any recognised form.
ToString()
Returns the canonical "S-NNN/M.m.c" form.
public override string ToString()
Returns
Remarks
The / separator is chosen deliberately to distinguish a
SpecRef string from a CatalogueRef string,
which uses @ (see ToString()). Keeping
the two forms visually distinct makes log lines and diagnostics
unambiguous even though both Parse(string) methods tolerate either
separator on input. Do not align these separators without also updating
the "distinguish from SpecRef" round-trip tests.
TryParse(string?, out SpecRef)
Tolerant variant of Parse(string) returning false on failure.
public static bool TryParse(string? s, out SpecRef value)