Struct OSVersion
Represents a version number consisting of major, minor, and point components.
Version numbers are often written as Major.Minor.Point
.
Inherited Members
Namespace: UnityEngine.XR.ARKit
Assembly: Unity.XR.ARKit.dll
Syntax
public struct OSVersion : IEquatable<OSVersion>, IComparable<OSVersion>
Constructors
OSVersion(int, int, int)
Constructs a new version number.
Declaration
public OSVersion(int major, int minor = 0, int point = 0)
Parameters
Type | Name | Description |
---|---|---|
int | major | The major version component. |
int | minor | The minor version component. |
int | point | The point version component. |
Properties
major
The major version component.
Declaration
public readonly int major { get; }
Property Value
Type | Description |
---|---|
int |
minor
The minor version component.
Declaration
public readonly int minor { get; }
Property Value
Type | Description |
---|---|
int |
point
The point version component.
Declaration
public readonly int point { get; }
Property Value
Type | Description |
---|---|
int |
Methods
CompareTo(OSVersion)
IComparable interface. This is useful for sorting routines.
Declaration
public int CompareTo(OSVersion version)
Parameters
Type | Name | Description |
---|---|---|
OSVersion | version | The other version to compare to. |
Returns
Type | Description |
---|---|
int | -1 if this |
Equals(object)
Compares for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare against. |
Returns
Type | Description |
---|---|
bool | Returns false if |
Overrides
Equals(OSVersion)
Compares for equality. The three version components are compared against other
's.
Declaration
public bool Equals(OSVersion other)
Parameters
Type | Name | Description |
---|---|---|
OSVersion | other | The |
Returns
Type | Description |
---|---|
bool |
GetHashCode()
Generates a hash code suitable for use in a HashSet
or Dictionary
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code. The same |
Overrides
Parse(string)
Parses a string which contains a version number of the form X.Y.Z somewhere in the string.
If multiple such substrings exists, the first is used. The parser stops when either
3 components have been identified, or when fewer than 3 components have been identified
and the next character is not a period (".") or a digit (0-9). If version
is null
or the empty string, this method returns the version 0.0.0
Declaration
public static OSVersion Parse(string version)
Parameters
Type | Name | Description |
---|---|---|
string | version | The string to parse. |
Returns
Type | Description |
---|---|
OSVersion | A new |
ToString()
Generates a string representation of the version.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
Operators
operator ==(OSVersion, OSVersion)
Tests whether lhs
is the same version as rhs
. This is the same as Equals(OSVersion).
Declaration
public static bool operator ==(OSVersion lhs, OSVersion rhs)
Parameters
Type | Name | Description |
---|---|---|
OSVersion | lhs | The left-hand side of the comparison. |
OSVersion | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
operator >(OSVersion, OSVersion)
Tests whether lhs
is a later version compared to rhs
.
Declaration
public static bool operator >(OSVersion lhs, OSVersion rhs)
Parameters
Type | Name | Description |
---|---|---|
OSVersion | lhs | The left-hand side of the comparison. |
OSVersion | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
operator >=(OSVersion, OSVersion)
Tests whether lhs
is the same or a later version compared to rhs
.
Declaration
public static bool operator >=(OSVersion lhs, OSVersion rhs)
Parameters
Type | Name | Description |
---|---|---|
OSVersion | lhs | The left-hand side of the comparison. |
OSVersion | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
operator !=(OSVersion, OSVersion)
Tests whether lhs
is a different version from rhs
.
Declaration
public static bool operator !=(OSVersion lhs, OSVersion rhs)
Parameters
Type | Name | Description |
---|---|---|
OSVersion | lhs | The left-hand side of the comparison. |
OSVersion | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
operator <(OSVersion, OSVersion)
Tests whether lhs
is an earlier version compared to rhs
.
Declaration
public static bool operator <(OSVersion lhs, OSVersion rhs)
Parameters
Type | Name | Description |
---|---|---|
OSVersion | lhs | The left-hand side of the comparison. |
OSVersion | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
operator <=(OSVersion, OSVersion)
Tests whether lhs
is the same or an earlier version compared to rhs
.
Declaration
public static bool operator <=(OSVersion lhs, OSVersion rhs)
Parameters
Type | Name | Description |
---|---|---|
OSVersion | lhs | The left-hand side of the comparison. |
OSVersion | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|