Class AlmostVersion
A type that wraps
Inherited Members
Namespace: IPA.Utilities
Assembly: IPA.Loader.dll
Syntax
public class AlmostVersion : IComparable<AlmostVersion>, IComparable<SemVer.Version>
Constructors
| Improve this Doc View SourceAlmostVersion(SemVer.Version)
Creates an AlmostVersion from the ver.
Declaration
public AlmostVersion(SemVer.Version ver)
Parameters
| Type | Name | Description |
|---|---|---|
| SemVer.Version | ver | the |
AlmostVersion(String)
Creates a new AlmostVersion with the version string provided in vertext.
Declaration
public AlmostVersion(string vertext)
Parameters
| Type | Name | Description |
|---|---|---|
| String | vertext | the version string to store |
AlmostVersion(String, AlmostVersion)
Creates a new AlmostVersion from the version string in vertext stored the
same way as the AlmostVersion passed in copyMode.
Declaration
public AlmostVersion(string vertext, AlmostVersion copyMode)
Parameters
| Type | Name | Description |
|---|---|---|
| String | vertext | the text to parse as an AlmostVersion |
| AlmostVersion | copyMode | an AlmostVersion to copy the storage mode of |
AlmostVersion(String, AlmostVersion.StoredAs)
Creates an AlmostVersion from the version string in vertext stored using
the storage mode specified in mode.
Declaration
public AlmostVersion(string vertext, AlmostVersion.StoredAs mode)
Parameters
| Type | Name | Description |
|---|---|---|
| String | vertext | the text to parse as an AlmostVersion |
| AlmostVersion.StoredAs | mode | the storage mode to store the version in |
Properties
| Improve this Doc View SourceSemverValue
The value of the AlmostVersion if it was stored as a
Declaration
public SemVer.Version SemverValue { get; }
Property Value
| Type | Description |
|---|---|
| SemVer.Version | the stored value as a |
StorageMode
The way the value is stored, whether it be as a
Declaration
public AlmostVersion.StoredAs StorageMode { get; }
Property Value
| Type | Description |
|---|---|
| AlmostVersion.StoredAs | the storage mode used to store this value |
StringValue
The value of the AlmostVersion if it was stored as a String.
Declaration
public string StringValue { get; }
Property Value
| Type | Description |
|---|---|
| String | the stored value as a String, or null if not stored as a string. |
Methods
| Improve this Doc View SourceCompareTo(AlmostVersion)
Compares langword_csharp_this to the AlmostVersion in other using
Declaration
public int CompareTo(AlmostVersion other)
Parameters
| Type | Name | Description |
|---|---|---|
| AlmostVersion | other | the AlmostVersion to compare to |
Returns
| Type | Description |
|---|---|
| Int32 | less than 0 if |
Remarks
The storage methods of the two objects must be the same, or this will throw an InvalidOperationException.
See Also
| Improve this Doc View SourceCompareTo(SemVer.Version)
Compares langword_csharp_this to the other using
Declaration
public int CompareTo(SemVer.Version other)
Parameters
| Type | Name | Description |
|---|---|---|
| SemVer.Version | other | the |
Returns
| Type | Description |
|---|---|
| Int32 | less than 0 if |
Remarks
The storage method of langword_csharp_this must be SemVer, else an InvalidOperationException will be thrown.
See Also
| Improve this Doc View SourceEquals(Object)
Performs a strict equality check between langword_csharp_this and obj.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | the object to compare to |
Returns
| Type | Description |
|---|---|
| Boolean | true if they are equal, false otherwise |
Overrides
Remarks
This may return false where Equality(AlmostVersion, AlmostVersion) returns true
See Also
| Improve this Doc View SourceGetHashCode()
Default generated hash code function generated by VS.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 | a value unique to each object, except those that are considered equal by Equals(Object) |
Overrides
See Also
| Improve this Doc View SourceToString()
Gets a string representation of the current version. If the value is stored as a string, this returns it. If it is
stored as a
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | a string representation of the current version |
Overrides
See Also
Operators
| Improve this Doc View SourceEquality(AlmostVersion, AlmostVersion)
Compares two versions, only taking into account the numeric part of the version if they are stored as
Declaration
public static bool operator ==(AlmostVersion l, AlmostVersion r)
Parameters
| Type | Name | Description |
|---|---|---|
| AlmostVersion | l | the first value to compare |
| AlmostVersion | r | the second value to compare |
Returns
| Type | Description |
|---|---|
| Boolean | true if they are mostly equal, false otherwise |
Remarks
This is a looser equality than Equals(Object), meaning that this may return true where Equals(Object) does not.
See Also
| Improve this Doc View SourceImplicit(AlmostVersion to SemVer.Version)
Implicitly converts an AlmostVersion to
Declaration
public static implicit operator SemVer.Version(AlmostVersion av)
Parameters
| Type | Name | Description |
|---|---|---|
| AlmostVersion | av | the AlmostVersion to convert to a |
Returns
| Type | Description |
|---|---|
| SemVer.Version |
See Also
| Improve this Doc View SourceImplicit(SemVer.Version to AlmostVersion)
Implicitly converts a
Declaration
public static implicit operator AlmostVersion(SemVer.Version ver)
Parameters
| Type | Name | Description |
|---|---|---|
| SemVer.Version | ver | the |
Returns
| Type | Description |
|---|---|
| AlmostVersion |
See Also
| Improve this Doc View SourceInequality(AlmostVersion, AlmostVersion)
The opposite of Equality(AlmostVersion, AlmostVersion). Equivalent to !(l == r).
Declaration
public static bool operator !=(AlmostVersion l, AlmostVersion r)
Parameters
| Type | Name | Description |
|---|---|---|
| AlmostVersion | l | the first value to compare |
| AlmostVersion | r | the second value to compare |
Returns
| Type | Description |
|---|---|
| Boolean | true if they are not mostly equal, false otherwise |