ignition/math/SemanticVersion.hh More...
#include <SemanticVersion.hh>
Public Member Functions | |
SemanticVersion () | |
Default constructor. | |
SemanticVersion (const SemanticVersion &_copy) | |
Copy constructor. | |
SemanticVersion (const std::string &_v) | |
Constructor. | |
SemanticVersion (const unsigned int _major, const unsigned int _minor=0, const unsigned int _patch=0, const std::string &_prerelease="", const std::string &_build="") | |
Constructor. | |
~SemanticVersion () | |
Destructor. | |
std::string | Build () const |
Get the build metadata string. | |
unsigned int | Major () const |
Get the major number. | |
unsigned int | Minor () const |
Get the minor number. | |
bool | operator!= (const SemanticVersion &_other) const |
Inequality comparison operator. | |
bool | operator< (const SemanticVersion &_other) const |
Less than comparison operator. | |
bool | operator<= (const SemanticVersion &_other) const |
Less than or equal comparison operator. | |
SemanticVersion & | operator= (const SemanticVersion &_other) |
Assignment operator. | |
bool | operator== (const SemanticVersion &_other) const |
Equality comparison operator. | |
bool | operator> (const SemanticVersion &_other) const |
Greater than comparison operator. | |
bool | operator>= (const SemanticVersion &_other) const |
Greater than or equal comparison operator. | |
bool | Parse (const std::string &_versionStr) |
Parse a version string and set the major, minor, patch numbers, and prerelease and build strings. | |
unsigned int | Patch () const |
Get the patch number. | |
std::string | Prerelease () const |
Get the prerelease string. | |
std::string | Version () const |
Returns the version as a string. |
ignition/math/SemanticVersion.hh
Version comparison class based on Semantic Versioning 2.0.0 http://semver.org/ Compares versions and converts versions from string.
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::SemanticVersion | ( | ) |
Default constructor.
Use the Parse function to populate an instance with version information.
Referenced by SemanticVersion(), operator!=(), operator<(), operator<<, operator<=(), operator=(), operator==(), operator>(), and operator>=().
|
explicit |
Constructor.
[in] | _v | the string version. ex: "0.3.2" |
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::SemanticVersion | ( | const SemanticVersion & | _copy | ) |
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::SemanticVersion | ( | const unsigned int | _major, |
const unsigned int | _minor = 0, | ||
const unsigned int | _patch = 0, | ||
const std::string & | _prerelease = "", | ||
const std::string & | _build = "" ) |
Constructor.
[in] | _major | The major number |
[in] | _minor | The minor number |
[in] | _patch | The patch number |
[in] | _prerelease | The prerelease string |
[in] | _build | The build metadata string |
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::~SemanticVersion | ( | ) |
Destructor.
std::string ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::Build | ( | ) | const |
Get the build metadata string.
Build meta data is not used when determining precedence.
unsigned int ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::Major | ( | ) | const |
Get the major number.
unsigned int ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::Minor | ( | ) | const |
Get the minor number.
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::operator!= | ( | const SemanticVersion & | _other | ) | const |
Inequality comparison operator.
[in] | _other | The other version to compare to |
References SemanticVersion().
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::operator< | ( | const SemanticVersion & | _other | ) | const |
Less than comparison operator.
[in] | _other | The other version to compare to |
References SemanticVersion().
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::operator<= | ( | const SemanticVersion & | _other | ) | const |
Less than or equal comparison operator.
[in] | _other | The other version to compare to |
References SemanticVersion().
SemanticVersion & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::operator= | ( | const SemanticVersion & | _other | ) |
Assignment operator.
[in] | _other | The version to assign from. |
References SemanticVersion().
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::operator== | ( | const SemanticVersion & | _other | ) | const |
Equality comparison operator.
[in] | _other | The other version to compare to |
References SemanticVersion().
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::operator> | ( | const SemanticVersion & | _other | ) | const |
Greater than comparison operator.
[in] | _other | The other version to compare to |
References SemanticVersion().
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::operator>= | ( | const SemanticVersion & | _other | ) | const |
Greater than or equal comparison operator.
[in] | _other | The other version to compare to |
References SemanticVersion().
bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::Parse | ( | const std::string & | _versionStr | ) |
Parse a version string and set the major, minor, patch numbers, and prerelease and build strings.
[in] | _versionStr | The version string, such as "1.2.3-pr+123" \retur True on success. |
unsigned int ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::Patch | ( | ) | const |
Get the patch number.
std::string ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::Prerelease | ( | ) | const |
Get the prerelease string.
std::string ignition::math::IGNITION_MATH_VERSION_NAMESPACE::SemanticVersion::Version | ( | ) | const |