CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
Version Class Reference

Software version tuple. More...

#include <cc/Version>

Public Member Functions

 Version ()
 Create an invalid version.
 
 Version (int major, int minor, int patch=0)
 Create new version.
 
 Version (const char *s)
 Parse version s.
 
 Version (const String &s)
 Parse version s.
 
 Version (std::uint32_t x)
 Read version encoded as 32-bit word x.
 
std::uint32_t toWord () const
 Convert to word value.
 
 operator std::uint32_t () const
 Convert to word value.
 
bool isValid () const
 Check if this version is valid.
 
 operator bool () const
 Check if this version is valid.
 
int major () const
 Major version number (0..255)
 
int minor () const
 Minor version number (0..255)
 
int patch () const
 Patch version number (0..65535)
 
String toString () const
 Convert to string.
 
bool operator== (const Version &other) const
 Equal to operator.
 
std::strong_ordering operator<=> (const Version &other) const
 Ordering operator.
 

Detailed Description

Software version tuple.

Constructor & Destructor Documentation

◆ Version() [1/5]

Version ( )

Create an invalid version.

◆ Version() [2/5]

Version ( int major,
int minor,
int patch = 0 )

Create new version.

Parameters
majorMajor version number (0..255)
minorMinor version number (0..255)
patchPatch version number (0..65535)

◆ Version() [3/5]

Version ( const char * s)

Parse version s.

◆ Version() [4/5]

Version ( const String & s)

Parse version s.

◆ Version() [5/5]

Version ( std::uint32_t x)
explicit

Read version encoded as 32-bit word x.

Member Function Documentation

◆ toWord()

std::uint32_t toWord ( ) const

Convert to word value.

◆ operator std::uint32_t()

operator std::uint32_t ( ) const

Convert to word value.

◆ isValid()

bool isValid ( ) const

Check if this version is valid.

◆ operator bool()

operator bool ( ) const
explicit

Check if this version is valid.

◆ major()

int major ( ) const

Major version number (0..255)

◆ minor()

int minor ( ) const

Minor version number (0..255)

◆ patch()

int patch ( ) const

Patch version number (0..65535)

◆ toString()

String toString ( ) const

Convert to string.

◆ operator==()

bool operator== ( const Version & other) const

Equal to operator.

◆ operator<=>()

std::strong_ordering operator<=> ( const Version & other) const

Ordering operator.