C# Класс Octopus.Client.Model.Versioning.StrictSemanticVersion

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Parse ( string value ) : StrictSemanticVersion

Parses a SemVer string using strict SemVer rules.

StrictSemanticVersion ( StrictSemanticVersion version ) : System

Creates a SemanticVersion from an existing SemanticVersion

StrictSemanticVersion ( int major, int minor, int patch ) : System

Creates a SemanticVersion X.Y.Z

StrictSemanticVersion ( int major, int minor, int patch, IEnumerable releaseLabels, string metadata ) : System

Creates a NuGetVersion X.Y.Z-alpha.1.2#build01

StrictSemanticVersion ( int major, int minor, int patch, string releaseLabel ) : System

Creates a NuGetVersion X.Y.Z-alpha

StrictSemanticVersion ( int major, int minor, int patch, string releaseLabel, string metadata ) : System

Creates a NuGetVersion X.Y.Z-alpha#build01

TryParse ( string value, StrictSemanticVersion &version ) : bool

Parse a version string

Защищенные методы

Метод Описание
StrictSemanticVersion ( System.Version version, IEnumerable releaseLabels, string metadata, bool preserveMissingComponents = false ) : System
StrictSemanticVersion ( System.Version version, string releaseLabel = null, string metadata = null ) : System
StrictSemanticVersion ( int major, int minor, int patch, int revision, IEnumerable releaseLabels, string metadata ) : System
StrictSemanticVersion ( int major, int minor, int patch, int revision, string releaseLabel, string metadata ) : System

Приватные методы

Метод Описание
IsLetterOrDigitOrDash ( char c ) : bool
IsValid ( string s, bool allowLeadingZeros ) : bool
IsValidPart ( char chars, bool allowLeadingZeros ) : bool
IsValidPart ( string s, bool allowLeadingZeros ) : bool
NormalizeVersionValue ( System.Version version ) : System.Version
ParseReleaseLabels ( string releaseLabels ) : IEnumerable
ParseSections ( string value ) : Tuple

Parse the version string into version/release/build The goal of this code is to take the most direct and optimized path to parsing and validating a semver. Regex would be much cleaner, but due to the number of versions created in NuGet Regex is too slow.

Описание методов

Parse() публичный статический Метод

Parses a SemVer string using strict SemVer rules.
public static Parse ( string value ) : StrictSemanticVersion
value string
Результат StrictSemanticVersion

StrictSemanticVersion() публичный Метод

Creates a SemanticVersion from an existing SemanticVersion
public StrictSemanticVersion ( StrictSemanticVersion version ) : System
version StrictSemanticVersion
Результат System

StrictSemanticVersion() защищенный Метод

protected StrictSemanticVersion ( System.Version version, IEnumerable releaseLabels, string metadata, bool preserveMissingComponents = false ) : System
version System.Version
releaseLabels IEnumerable
metadata string
preserveMissingComponents bool
Результат System

StrictSemanticVersion() защищенный Метод

protected StrictSemanticVersion ( System.Version version, string releaseLabel = null, string metadata = null ) : System
version System.Version
releaseLabel string
metadata string
Результат System

StrictSemanticVersion() публичный Метод

Creates a SemanticVersion X.Y.Z
public StrictSemanticVersion ( int major, int minor, int patch ) : System
major int X.y.z
minor int x.Y.z
patch int x.y.Z
Результат System

StrictSemanticVersion() публичный Метод

Creates a NuGetVersion X.Y.Z-alpha.1.2#build01
public StrictSemanticVersion ( int major, int minor, int patch, IEnumerable releaseLabels, string metadata ) : System
major int X.y.z
minor int x.Y.z
patch int x.y.Z
releaseLabels IEnumerable Release labels that have been split by the dot separator
metadata string Build metadata
Результат System

StrictSemanticVersion() защищенный Метод

protected StrictSemanticVersion ( int major, int minor, int patch, int revision, IEnumerable releaseLabels, string metadata ) : System
major int
minor int
patch int
revision int
releaseLabels IEnumerable
metadata string
Результат System

StrictSemanticVersion() защищенный Метод

protected StrictSemanticVersion ( int major, int minor, int patch, int revision, string releaseLabel, string metadata ) : System
major int
minor int
patch int
revision int
releaseLabel string
metadata string
Результат System

StrictSemanticVersion() публичный Метод

Creates a NuGetVersion X.Y.Z-alpha
public StrictSemanticVersion ( int major, int minor, int patch, string releaseLabel ) : System
major int X.y.z
minor int x.Y.z
patch int x.y.Z
releaseLabel string Prerelease label
Результат System

StrictSemanticVersion() публичный Метод

Creates a NuGetVersion X.Y.Z-alpha#build01
public StrictSemanticVersion ( int major, int minor, int patch, string releaseLabel, string metadata ) : System
major int X.y.z
minor int x.Y.z
patch int x.y.Z
releaseLabel string Prerelease label
metadata string Build metadata
Результат System

TryParse() публичный статический Метод

Parse a version string
public static TryParse ( string value, StrictSemanticVersion &version ) : bool
value string
version StrictSemanticVersion
Результат bool