ESP32-OTA-Updater
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Version Class Reference

Represents a semantic version. More...

#include <SemanticVersion.h>

Public Member Functions

 Version ()
 Constructs a Version object with all version numbers set to 0.
 
 Version (int major, int minor, int patch)
 Constructs a Version object with the specified major, minor, and patch version numbers.
 
 Version (const char *version)
 Constructs a Version object from a string representation of the version.
 
int getMajor () const
 Gets the major version number.
 
int getMinor () const
 Gets the minor version number.
 
int getPatch () const
 Gets the patch version number.
 
bool operator== (const Version &other) const
 Checks if this Version object is equal to another Version object.
 
bool operator!= (const Version &other) const
 Checks if this Version object is not equal to another Version object.
 
bool operator< (const Version &other) const
 Checks if this Version object is less than another Version object.
 
bool operator> (const Version &other) const
 Checks if this Version object is greater than another Version object.
 
bool operator<= (const Version &other) const
 Checks if this Version object is less than or equal to another Version object.
 
bool operator>= (const Version &other) const
 Checks if this Version object is greater than or equal to another Version object.
 

Detailed Description

Represents a semantic version.

Constructor & Destructor Documentation

◆ Version() [1/2]

Version::Version ( int  major,
int  minor,
int  patch 
)
inline

Constructs a Version object with the specified major, minor, and patch version numbers.

Parameters
majorThe major version number.
minorThe minor version number.
patchThe patch version number.

◆ Version() [2/2]

Version::Version ( const char *  version)
inline

Constructs a Version object from a string representation of the version.

Parameters
versionThe string representation of the version. The format should be "vX.Y.Z" or "X.Y.Z", where X, Y, and Z are integers.

Member Function Documentation

◆ getMajor()

int Version::getMajor ( ) const
inline

Gets the major version number.

Returns
The major version number.

◆ getMinor()

int Version::getMinor ( ) const
inline

Gets the minor version number.

Returns
The minor version number.

◆ getPatch()

int Version::getPatch ( ) const
inline

Gets the patch version number.

Returns
The patch version number.

◆ operator!=()

bool Version::operator!= ( const Version other) const
inline

Checks if this Version object is not equal to another Version object.

Parameters
otherThe other Version object to compare with.
Returns
True if the two Version objects are not equal, false otherwise.

◆ operator<()

bool Version::operator< ( const Version other) const
inline

Checks if this Version object is less than another Version object.

Parameters
otherThe other Version object to compare with.
Returns
True if this Version object is less than the other Version object, false otherwise.

◆ operator<=()

bool Version::operator<= ( const Version other) const
inline

Checks if this Version object is less than or equal to another Version object.

Parameters
otherThe other Version object to compare with.
Returns
True if this Version object is less than or equal to the other Version object, false otherwise.

◆ operator==()

bool Version::operator== ( const Version other) const
inline

Checks if this Version object is equal to another Version object.

Parameters
otherThe other Version object to compare with.
Returns
True if the two Version objects are equal, false otherwise.

◆ operator>()

bool Version::operator> ( const Version other) const
inline

Checks if this Version object is greater than another Version object.

Parameters
otherThe other Version object to compare with.
Returns
True if this Version object is greater than the other Version object, false otherwise.

◆ operator>=()

bool Version::operator>= ( const Version other) const
inline

Checks if this Version object is greater than or equal to another Version object.

Parameters
otherThe other Version object to compare with.
Returns
True if this Version object is greater than or equal to the other Version object, false otherwise.

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