Cupt
Functions
versionstring.hpp File Reference
#include <cupt/common.hpp>
#include <cupt/stringrange.hpp>

Go to the source code of this file.

Functions

bool cupt::checkVersionString (const string &versionString, bool throwOnError=true)
 checks version string for correctness More...
 
int cupt::compareVersionStrings (const string &left, const string &right)
 compares two version strings More...
 
StringRange cupt::getOriginalVersionString (const StringRange &versionString)
 gets the original part of possibly Cupt-modified version string More...
 

Function Documentation

◆ checkVersionString()

bool cupt::checkVersionString ( const string &  versionString,
bool  throwOnError = true 
)

checks version string for correctness

Equal to checkPackageName, only checks version string instead of package name

◆ compareVersionStrings()

int cupt::compareVersionStrings ( const string &  left,
const string &  right 
)

compares two version strings

Parameters
leftleft version string
rightright version string
Returns
-1, if left < right, 0 if left == right, 1 if left > right
Note
The version strings may be logically equal even if they are not physically equal. Unless you are comparing version strings that belong to the same cache::Package, you should use this function to test their equality.

◆ getOriginalVersionString()

StringRange cupt::getOriginalVersionString ( const StringRange versionString)

gets the original part of possibly Cupt-modified version string

Cupt may apply Cupt-specific id suffixes to original version strings for its own use, mainly for distinguishing version which declare same version strings in the metadata but (possibly) having different content.

This function tells the version string as it was seen in the metadata.

Parameters
versionString