Public Member Functions

 Version (int major, int minor, int build, int revision)
 
 Version (int major, int minor, int build)
 
 Version (int major, int minor)
 
 Version (const String &version)
 
 Version ()
 Constructs an instance that represents version number 0.0.-1.-1. More...
 
int get_Major () const
 Returns the major version. More...
 
int get_Minor () const
 Returns the minor version. More...
 
int get_Build () const
 Returns the build number. More...
 
int get_Revision () const
 Returns the revision number. More...
 
int16_t get_MajorRevision () const
 Returns the high 16-bit value of the revision number. More...
 
int16_t get_MinorRevision () const
 Returns the low 16-bit value of the revision number. More...
 
int CompareTo (const Version &ver) const
 
int GetHashCode () const
 Returns a hash code for the current object. More...
 
bool Equals (const Version &ver) const
 
String ToString () const
 Returns the string representation of the version number represented by the current object. More...
 
String ToString (int fieldCount) const
 

Static Public Member Functions

static Version Parse (const String &input)
 

Friends

bool operator== (const Version &lhs, const Version &rhs)
 
bool operator!= (const Version &lhs, const Version &rhs)
 
bool operator< (const Version &lhs, const Version &rhs)
 
bool operator<= (const Version &lhs, const Version &rhs)
 
bool operator> (const Version &lhs, const Version &rhs)
 
bool operator>= (const Version &lhs, const Version &rhs)
 

Detailed Description

Represents a version number. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

Constructor & Destructor Documentation

◆ Version() [1/5]

System::Version::Version ( int  major,
int  minor,
int  build,
int  revision 
)

Constructs an instance that represent the specified major, minor, build and revsion values.

Parameters
majorThe major version number
minorThe minor version numebr
buildThe build number
revisionThe revision number

◆ Version() [2/5]

System::Version::Version ( int  major,
int  minor,
int  build 
)

Constructs an instance that represent the specified major, minor and build values.

Parameters
majorThe major version number
minorThe minor version numebr
buildThe build number

◆ Version() [3/5]

System::Version::Version ( int  major,
int  minor 
)

Constructs an instance that represent the specified major and values.

Parameters
majorThe major version number
minorThe minor version numebr

◆ Version() [4/5]

System::Version::Version ( const String version)

Constructs an instance that represent the version number represented as a string.

Parameters
versionThe string containing a version number

◆ Version() [5/5]

System::Version::Version ( )

Constructs an instance that represents version number 0.0.-1.-1.

Member Function Documentation

◆ CompareTo()

int System::Version::CompareTo ( const Version ver) const

Compares the versions represented by the current object and the specified object.

Parameters
verA Version object to compare with the current object
Returns
-1 if the version number represented by the current object is less than that represented by ver; 0 if the version numbers are equal; 1 if the version number represented by the current object is greater than the value represented by ver

◆ Equals()

bool System::Version::Equals ( const Version ver) const

Determines if the version numbers represented by the current and the specified objects are equal.

Parameters
verA Version object to compare the current object with
Returns
True if version numbers represented by the current object and the specified object are equal, otherwise - false

◆ get_Build()

int System::Version::get_Build ( ) const

Returns the build number.

◆ get_Major()

int System::Version::get_Major ( ) const

Returns the major version.

◆ get_MajorRevision()

int16_t System::Version::get_MajorRevision ( ) const

Returns the high 16-bit value of the revision number.

◆ get_Minor()

int System::Version::get_Minor ( ) const

Returns the minor version.

◆ get_MinorRevision()

int16_t System::Version::get_MinorRevision ( ) const

Returns the low 16-bit value of the revision number.

◆ get_Revision()

int System::Version::get_Revision ( ) const

Returns the revision number.

◆ GetHashCode()

int System::Version::GetHashCode ( ) const

Returns a hash code for the current object.

◆ Parse()

static Version System::Version::Parse ( const String input)
static

Converts the string representation of a version number into equivalent instance of Version class.

Parameters
inputA string containing the string representation of a version number
Returns
An instance of Version class that represents the version number equivalent to that represented by the input

◆ ToString() [1/2]

String System::Version::ToString ( ) const

Returns the string representation of the version number represented by the current object.

◆ ToString() [2/2]

String System::Version::ToString ( int  fieldCount) const

Returns the string representation of the specified number of sections of version number represented by the current object.

Parameters
fieldCountThe number of sections of the version number to include in the string representation returned
Returns
The string representation of the version number represented by the current object

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const Version lhs,
const Version rhs 
)
friend

Determines if the version numbers represented by the specified Version objects are not equal.

Parameters
lhsThe first comparand
rhsThe second comparand
Returns
True if the version numbers represented by lhs and rhs are not equal, otherwise - false

◆ operator

bool operator< ( const Version lhs,
const Version rhs 
)
friend

Determines the relation between the version numbers represented by the specified Version objects

Parameters
lhsThe first comparand
rhsThe second comparand
Returns
True if the version number represented by lhs is less than the version number represented rh, otherwise - false

◆ operator<>

bool operator<= ( const Version lhs,
const Version rhs 
)
friend

Determines the relation between the version numbers represented by the specified Version objects

Parameters
lhsThe first comparand
rhsThe second comparand
Returns
True if the version number represented by lhs is less than or equal to the version number represented rh, otherwise - false

◆ operator==

bool operator== ( const Version lhs,
const Version rhs 
)
friend

Determines if the version numbers represented by the specified Version objects are equal.

Parameters
lhsThe first comparand
rhsThe second comparand
Returns
True if the version numbers represented by lhs and rhs are equal, otherwise - false

◆ operator>

bool operator> ( const Version lhs,
const Version rhs 
)
friend

Determines the relation between the version numbers represented by the specified Version objects

Parameters
lhsThe first comparand
rhsThe second comparand
Returns
True if the version number represented by lhs is greater than the version number represented rh, otherwise - false

◆ operator>=

bool operator>= ( const Version lhs,
const Version rhs 
)
friend

Determines the relation between the version numbers represented by the specified Version objects

Parameters
lhsThe first comparand
rhsThe second comparand
Returns
True if the version number represented by lhs is greater than or equal to the version number represented rh, otherwise - false