PLCnext API Documentation 25.0.2.69
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
Arp::Base::Core::Version Class Reference

This class provides versioning. More...

#include <Version.hpp>

Public Types

using Value = uint32
 

Public Member Functions

 Version (Value major, Value minor=0, Value patch=0, Value build=0)
 Constructs an Version instance. More...
 
 Version (void)
 Default constructor.
 
 Version (const Version &arg)
 Default copy constructor.
 
 Version (Version &&arg) noexcept
 Default move constructor.
 
Versionoperator= (const Version &arg)
 Default copy-assignment operator.
 
Versionoperator= (Version &&arg) noexcept
 Default move-assignment operator.
 
 ~Version (void)
 Default destructor.
 
Value GetMajor (void) const
 Gets the major version. More...
 
Value GetMinor (void) const
 Gets the minor version. More...
 
Value GetPatch (void) const
 Gets the patch version. More...
 
Value GetBuildNumber (void) const
 Gets the build number. More...
 
String ToString (void) const
 Converts this version to a string as explained here Version. More...
 
 Version (Value major, Value minor, Value patch, Value build, const String &state, const String &name)
 DEPRECATED. More...
 
const StringGetName (void) const
 DEPRECATED. More...
 
const StringGetState (void) const
 DEPRECATED. More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Static Public Member Functions

static Version Parse (const String &input)
 Parses the given input string and creates a new version from it. More...
 
static bool TryParse (const String &input, Version &result)
 Tries to parse the given input string and to create a new version from it. More...
 

Friends

ARP_EXPORT bool operator== (const Version &left, const Version &right)
 Compares the left argument to the right argument on equality More...
 
ARP_EXPORT std::strong_ordering operator<=> (const Version &left, const Version &right)
 Threeway compares the left argument to the right argument More...
 
ARP_EXPORT std::ostream & operator<< (std::ostream &os, const Version &arg)
 
ARP_EXPORT std::istream & operator>> (std::istream &is, Version &arg)
 

Detailed Description

This class provides versioning.

The total version consists of major, minor, patch and build versions.

Constructor & Destructor Documentation

◆ Version() [1/2]

Arp::Base::Core::Version::Version ( Value  major,
Value  minor = 0,
Value  patch = 0,
Value  build = 0 
)
explicit

Constructs an Version instance.

Parameters
majorThe major version.
minorThe minor version.
patchThe patch version.
buildThe build version.

◆ Version() [2/2]

Arp::Base::Core::Version::Version ( Value  major,
Value  minor,
Value  patch,
Value  build,
const String state,
const String name 
)

DEPRECATED.

Use class ArpVersion instead.

Member Function Documentation

◆ GetBuildNumber()

Version::Value Arp::Base::Core::Version::GetBuildNumber ( void  ) const

Gets the build number.

Returns
The build number.

◆ GetMajor()

Version::Value Arp::Base::Core::Version::GetMajor ( void  ) const

Gets the major version.

Returns
The major version.

◆ GetMinor()

Version::Value Arp::Base::Core::Version::GetMinor ( void  ) const

Gets the minor version.

Returns
The minor version.

◆ GetName()

const String & Arp::Base::Core::Version::GetName ( void  ) const

DEPRECATED.

Use class ArpVersion instead.

◆ GetPatch()

Version::Value Arp::Base::Core::Version::GetPatch ( void  ) const

Gets the patch version.

Returns
The patch version.

◆ GetState()

const String & Arp::Base::Core::Version::GetState ( void  ) const

DEPRECATED.

Use class ArpVersion instead.

◆ Parse()

Version Arp::Base::Core::Version::Parse ( const String input)
static

Parses the given input string and creates a new version from it.

Parameters
inputThe input string to parse.
Returns
The resulting version of the input string was valid
Exceptions
ExceptionIf the input string is not valid.

◆ ToString()

String Arp::Base::Core::Version::ToString ( void  ) const

Converts this version to a string as explained here Version.

Returns
The formatted version string.

◆ TryParse()

bool Arp::Base::Core::Version::TryParse ( const String input,
Version result 
)
static

Tries to parse the given input string and to create a new version from it.

Parameters
inputThe input string to parse.
resultThe resulting version.
Returns
true if the given input string could be parsed, otherwise false.

Friends And Related Function Documentation

◆ operator<=>

ARP_EXPORT std::strong_ordering operator<=> ( const Version left,
const Version right 
)
friend

Threeway compares the left argument to the right argument

Parameters
leftThe left argument to compare the right argument to.
rightThe right argument to be compared to the left argument.
Returns
std::strong_ordering result value

Other comparison operators like <, <=, >, >= will be generated by the compiler based on this function.

◆ operator==

ARP_EXPORT bool operator== ( const Version left,
const Version right 
)
friend

Compares the left argument to the right argument on equality

Parameters
leftThe left argument to compare the right argument to.
rightThe right argument to be compared to the left argument.
Returns
true if the left argument is equal to the right argument, otherwise false.

The documentation for this class was generated from the following files: