kim-api  2.3.0+v2.3.0.GNU.GNU.
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
Functions
KIM::SEM_VER Namespace Reference

Contains routines related to the KIM API Semantic Version. More...

Functions

std::string const & GetSemVer ()
 Get the KIM API complete Semantic Version string. More...
 
int IsLessThan (std::string const &lhs, std::string const &rhs, int *const isLessThan)
 Compare two Semantic Version strings. More...
 
int ParseSemVer (std::string const &version, int *const major, int *const minor, int *const patch, std::string *const prerelease, std::string *const buildMetadata)
 Parse Semantic Version string into its six components. More...
 

Detailed Description

Contains routines related to the KIM API Semantic Version.

Function Documentation

◆ GetSemVer()

std::string const& KIM::SEM_VER::GetSemVer ( )

Get the KIM API complete Semantic Version string.

See also
KIM_SEM_VER_GetSemVer, kim_sem_ver_module::kim_get_sem_ver
Since
2.0

◆ IsLessThan()

int KIM::SEM_VER::IsLessThan ( std::string const &  lhs,
std::string const &  rhs,
int *const  isLessThan 
)

Compare two Semantic Version strings.

See the Semantic Version 2.0.0 standard for the definition of the partial ordering for valid Semantic Version strings.

Parameters
[in]lhsLeft hand side version string in comparison.
[in]rhsRight hand side version string in comparison.
[out]isLessThanTruth value of lhs < rhs as defined by the Semantic Version 2.0.0 standard.
Returns
true if ParseSemVer returns true for lhs or rhs.
false otherwise.
See also
KIM_SEM_VER_IsLessThan, kim_sem_ver_module::kim_is_less_than
Since
2.0

◆ ParseSemVer()

int KIM::SEM_VER::ParseSemVer ( std::string const &  version,
int *const  major,
int *const  minor,
int *const  patch,
std::string *const  prerelease,
std::string *const  buildMetadata 
)

Parse Semantic Version string into its six components.

See the Semantic Version 2.0.0 standard for definitions of valid Semantic Version strings.

Parameters
[in]versionThe Semantic Version string to be parsed.
[out]majorThe major version number.
[out]minorThe minor version number.
[out]patchThe patch version number.
[out]prereleaseThe prerelease string.
[out]buildMetadataThe build metadata string.
Returns
true if minor and/or patch are missing.
true if major number has a leading zero or is not a valid integer.
true if minor number has a leading zero or is not a valid integer.
true if patch number has a leading zero or is not a valid integer.
true if the prerelease string is invalid.
true if the build metadata string is invalid.
false otherwise.
Precondition
All output arguments may be NULL if the corresponding value is not needed.
Postcondition
All output arguments are unchanged if an error occurs.
See also
KIM_SEM_VER_ParseSemVer, kim_sem_ver_module::kim_parse_sem_ver
Since
2.0