Struct OSVersion
Represents a version number consisting of major, minor, and point compnents.
Version numbers are often written as Major.Minor.Point
.
Namespace: UnityEngine.XR.ARKit
Syntax
public struct OSVersion : IEquatable<OSVersion>, IComparable<OSVersion>
Constructors
OSVersion(Int32, Int32, Int32)
Constructs a new version number.
Declaration
public OSVersion(int major, int minor = 0, int point = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | major | The major version component |
Int32 | minor | The minor version component |
Int32 | point | The point version component |
Properties
major
The major version component.
Declaration
public int major { get; }
Property Value
Type | Description |
---|---|
Int32 |
minor
The minor version component.
Declaration
public int minor { get; }
Property Value
Type | Description |
---|---|
Int32 |
point
The point version component.
Declaration
public int point { get; }
Property Value
Type | Description |
---|---|
Int32 |
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 |
---|---|
Int32 | -1 if this OSVersion is less than |
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 |
---|---|
Boolean | 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 OSVersion to compare for equality. |
Returns
Type | Description |
---|---|
Boolean |
GetHashCode()
Generates a hash code suitable for use in a HashSet or Dictionary.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | 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 less 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
Equality(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 |
---|---|
Boolean |
|
GreaterThan(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 |
---|---|
Boolean |
|
GreaterThanOrEqual(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 |
---|---|
Boolean |
|
Inequality(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 |
---|---|
Boolean |
|
LessThan(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 |
---|---|
Boolean |
|
LessThanOrEqual(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 |
---|---|
Boolean |
|