CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::Version Class Reference

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. More...

#include <version.h>

Public Member Functions

 Version (int major, int minor, int build, int revision)
 Constructs an instance that represent the specified major, minor, build and revsion values. More...
 
 Version (int major, int minor, int build)
 Constructs an instance that represent the specified major, minor and build values. More...
 
 Version (int major, int minor)
 Constructs an instance that represent the specified major and values. More...
 
 Version (const String &version)
 Constructs an instance that represent the version number represented as a string. More...
 
 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
 Compares the versions represented by the current object and the specified object. More...
 
int GetHashCode () const
 Returns a hash code for the current object. More...
 
bool Equals (const Version &ver) const
 Determines if the version numbers represented by the current and the specified objects are equal. More...
 
String ToString () const
 Returns the string representation of the version number represented by the current object. More...
 
String ToString (int fieldCount) const
 Returns the string representation of the specified number of sections of version number represented by the current object. More...
 

Static Public Member Functions

static Version Parse (const String &input)
 Converts the string representation of a version number into equivalent instance of Version class. More...
 

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