Math v0.0.1
Version

Version information container. More...

#include <version.hpp>

Public Member Functions

constexpr Version (uint8 major=0, uint8 minor=0, uint8 patch=0, uint8 build=0) noexcept
 Creates a new version structure.
 
constexpr Version (uint32 version) noexcept
 Creates a new version structure from encoded data.
 
constexpr operator uint32 () const noexcept
 Encodes version data to the integer value.
 
uint8operator[] (psize i) noexcept
 Returns version part by the index.
 
uint8 operator[] (psize i) const noexcept
 Returns version part by the index.
 
constexpr bool operator< (Version v) const noexcept
 
constexpr bool operator> (Version v) const noexcept
 
constexpr bool operator<= (Version v) const noexcept
 
constexpr bool operator>= (Version v) const noexcept
 
constexpr bool operator== (Version v) const noexcept
 
constexpr bool operator!= (Version v) const noexcept
 
string toString4 () const noexcept
 Creates a new version string. (X.X.X.X)
 
string toString3 () const noexcept
 Creates a new version string. (X.X.X)
 
string toString2 () const noexcept
 Creates a new version string. (X.X)
 
string toString1 () const noexcept
 Creates a new version string. (X)
 

Public Attributes

uint8 major
 
uint8 minor
 
uint8 patch
 
uint8 build
 

Detailed Description

Version information container.

Made of major, minor, patch and build parts.

Constructor & Destructor Documentation

◆ Version() [1/2]

constexpr Version ( uint8 major = 0,
uint8 minor = 0,
uint8 patch = 0,
uint8 build = 0 )
inlineconstexprnoexcept

Creates a new version structure.

Parameters
majorversion major part value
minorversion minor part value
patchversion patch part value
buildversion build part value

◆ Version() [2/2]

constexpr Version ( uint32 version)
inlineconstexprnoexcept

Creates a new version structure from encoded data.

Parameters
versiontarget version encoded data

Member Function Documentation

◆ operator[]() [1/2]

uint8 & operator[] ( psize i)
inlinenoexcept

Returns version part by the index.

Parameters
itarget version part index

◆ operator[]() [2/2]

uint8 operator[] ( psize i) const
inlinenoexcept

Returns version part by the index.

Parameters
itarget version part index

Member Data Documentation

◆ major

uint8 major

Major version part.

◆ minor

uint8 minor

Minor version part.

◆ patch

uint8 patch

Patch version part.

◆ build

uint8 build

Build version part.