@@ -30,12 +30,7 @@ public readonly struct CSemVer
30
30
/// <param name="minor">Minor version value [0-49999]</param>
31
31
/// <param name="patch">Patch version value [0-9999]</param>
32
32
/// <param name="preRelVersion">Pre-release version information (if a pre-release build)</param>
33
- /// <param name="buildMetaData">[Optional]Additional build meta data [default: empty string]</param>
34
- /// <remarks>
35
- /// This is used internally when converting from a File Version as those only have a single bit
36
- /// to indicate if they are a Release/CI build. The rest of the information is lost and therefore
37
- /// does not participate in ordering.
38
- /// </remarks>
33
+ /// <param name="buildMetaData">Any additional build meta data [default: empty string]</param>
39
34
public CSemVer ( int major
40
35
, int minor
41
36
, int patch
@@ -77,8 +72,10 @@ public CSemVer( int major
77
72
/// <summary>Gets the <see cref="FileVersionQuad"/> representation of this <see cref="CSemVer"/></summary>
78
73
/// <remarks>
79
74
/// Since a <see cref="FileVersionQuad"/> is entirely numeric the conversion is somewhat "lossy" but does
80
- /// NOT lose any relation to other versions converted. That, is the loss does not include any information
81
- /// that impacts build version sort ordering. (any data lost is ignored for sort ordering anyway)
75
+ /// NOT lose any relation to other released versions converted. That, is the loss does not include any CI
76
+ /// information, only that it was a CI build. Two CI builds with the same base version will produce the
77
+ /// same value! CI builds are not intended for long term stability and this is not a bug but a design of
78
+ /// how CSemVer (and CSemVer-CI) work to produce a <see cref="FileVersionQuad"/>.
82
79
/// </remarks>
83
80
public FileVersionQuad FileVersion
84
81
{
@@ -119,7 +116,8 @@ public ulong OrderedVersion
119
116
/// <summary>Gets a value indicating whether this is a zero based version</summary>
120
117
public bool IsZero => Major == 0 && Minor == 0 && Patch == 0 ;
121
118
122
- /// <inheritdoc/>
119
+ /// <summary>Converts the internal representation of this version to a valid CSemVer formatted string</summary>
120
+ /// <returns>CSemVer formatted string</returns>
123
121
public override string ToString ( )
124
122
{
125
123
return ConstrainedVersion ? . ToString ( ) ?? string . Empty ;
@@ -183,9 +181,9 @@ public override int GetHashCode( )
183
181
/// <returns><see langword="true"/> if the conversion is performed or <see langword="false"/> if not (<paramref name="reason"/> will hold reason it is not successful)</returns>
184
182
/// <remarks>
185
183
/// While EVERY <see cref="CSemVer"/> conforms to valid <see cref="SemVer"/> the reverse is not always true.
186
- /// This method attempts to make a conversion using the classic try pattern with the inclusion of a string
184
+ /// This method attempts to make a conversion using the classic try pattern with the inclusion of an exception
187
185
/// that explains the reason for any failures. This is useful in debugging or for creating wrappers that will
188
- /// throw an exception.
186
+ /// throw the exception.
189
187
/// </remarks>
190
188
public static bool TryFrom (
191
189
SemVer ver ,
@@ -273,7 +271,7 @@ public static CSemVer From( UInt64 fileVersion, IReadOnlyCollection<string>? bui
273
271
/// <summary>Converts a CSemVer ordered version integral value (UInt64) into a full <see cref="CSemVer"/></summary>
274
272
/// <param name="orderedVersion">The ordered version value</param>
275
273
/// <param name="buildMetaData">Optional build meta data value for the version</param>
276
- /// <returns><see cref="CSemVer"/> corresponding to the ordered version number provided</returns>
274
+ /// <returns>Version corresponding to the ordered version number provided</returns>
277
275
public static CSemVer FromOrderedVersion ( UInt64 orderedVersion , IReadOnlyCollection < string > ? buildMetaData = null )
278
276
{
279
277
buildMetaData ??= [ ] ;
@@ -314,7 +312,7 @@ public static CSemVer FromOrderedVersion( UInt64 orderedVersion, IReadOnlyCollec
314
312
/// <summary>Factory method to create a <see cref="CSemVer"/> from information available as part of a build</summary>
315
313
/// <param name="buildVersionXmlPath">Path to the BuildVersion XML data for the repository</param>
316
314
/// <param name="buildMeta">Additional Build meta data for the build</param>
317
- /// <returns><see cref="CSemVer"/> </returns>
315
+ /// <returns>Version information parsed from the build XML </returns>
318
316
public static CSemVer From ( string buildVersionXmlPath , IReadOnlyCollection < string > ? buildMeta )
319
317
{
320
318
var parsedBuildVersionXml = ParsedBuildVersionXml . ParseFile ( buildVersionXmlPath ) ;
@@ -343,6 +341,9 @@ public static CSemVer Parse( string s, IFormatProvider? provider )
343
341
}
344
342
345
343
/// <inheritdoc/>
344
+ /// <remarks>
345
+ /// <paramref name="provider"/> is ALWAYS ignored by this implementation. The format is defined by the spec and independent of culture.
346
+ /// </remarks>
346
347
public static bool TryParse ( [ NotNullWhen ( true ) ] string ? s , IFormatProvider ? provider , [ MaybeNullWhen ( false ) ] out CSemVer result )
347
348
{
348
349
return TryParse ( s , out result , out _ ) ;
0 commit comments