Table of Contents

Struct SpecVersion

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

A three-component S-100 version of the form <major>.<minor>.<clarification>, with the compatibility semantics defined by S-100 Edition 5.2.1 Part 2 §6 (Maintenance):

  • Major — backward-incompatible change.
  • Minor — backward-compatible addition (new feature classes, attributes, code-list entries, etc.).
  • Clarification — editorial change with no semantic impact on the data model.

This is not Semantic Versioning despite its similar shape — there are no pre-release tags, no build metadata, and clarification-level differences are interchangeable for compatibility purposes.

public readonly record struct SpecVersion : IComparable<SpecVersion>, IEquatable<SpecVersion>
Implements
Inherited Members

Constructors

SpecVersion(int, int, int)

Creates a new SpecVersion. All components must be non-negative.

public SpecVersion(int major, int minor, int clarification)

Parameters

major int
minor int
clarification int

Properties

Clarification

Clarification component (editorial-only changes).

public int Clarification { get; }

Property Value

int

Major

Major component (backward-incompatible change boundary).

public int Major { get; }

Property Value

int

Minor

Minor component (backward-compatible additions).

public int Minor { get; }

Property Value

int

Methods

CompareTo(SpecVersion)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(SpecVersion other)

Parameters

other SpecVersion

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

IsBackwardCompatibleWith(SpecVersion)

Returns true when a consumer conforming to this version can read content produced for older — i.e. the two share the same major component and this version's minor is at least as high as the older one's. Clarification-level differences are ignored per S-100 Part 2 §6.

public bool IsBackwardCompatibleWith(SpecVersion older)

Parameters

older SpecVersion

Returns

bool

Parse(string)

Parses a version string of the form "M", "M.m", or "M.m.c". Missing trailing components default to 0.

public static SpecVersion Parse(string s)

Parameters

s string

Returns

SpecVersion

Exceptions

FormatException

The input is not a valid version string.

ToString()

Returns the canonical "M.m.c" representation.

public override string ToString()

Returns

string

TryParse(string?, out SpecVersion)

Attempts to parse a version string of the form "M", "M.m", or "M.m.c". Missing trailing components default to 0.

public static bool TryParse(string? s, out SpecVersion value)

Parameters

s string
value SpecVersion

Returns

bool

Operators

operator >(SpecVersion, SpecVersion)

Returns true when left follows right (see CompareTo(SpecVersion)).

public static bool operator >(SpecVersion left, SpecVersion right)

Parameters

left SpecVersion

The first version.

right SpecVersion

The second version.

Returns

bool

operator >=(SpecVersion, SpecVersion)

Returns true when left follows or equals right (see CompareTo(SpecVersion)).

public static bool operator >=(SpecVersion left, SpecVersion right)

Parameters

left SpecVersion

The first version.

right SpecVersion

The second version.

Returns

bool

operator <(SpecVersion, SpecVersion)

Returns true when left precedes right (see CompareTo(SpecVersion)).

public static bool operator <(SpecVersion left, SpecVersion right)

Parameters

left SpecVersion

The first version.

right SpecVersion

The second version.

Returns

bool

operator <=(SpecVersion, SpecVersion)

Returns true when left precedes or equals right (see CompareTo(SpecVersion)).

public static bool operator <=(SpecVersion left, SpecVersion right)

Parameters

left SpecVersion

The first version.

right SpecVersion

The second version.

Returns

bool