Flox Package Database 1
CRUD Operations on Nix Package Metadata
Loading...
Searching...
No Matches
Namespaces | Macros | Functions | Variables
versions.cc File Reference

Interfaces used to perform version number analysis, especially Semantic Version processing. More...

#include <istream>
#include <list>
#include <map>
#include <optional>
#include <regex>
#include <string>
#include <string_view>
#include <sys/types.h>
#include <utility>
#include <vector>
#include <nix/types.hh>
#include <nix/util.hh>
#include "versions.hh"

Namespaces

namespace  versions
 Interfaces for analyzing version numbers.
 

Macros

#define SEMVER_PATH   "semver"
 

Functions

bool versions::isSemver (const std::string &version)
 
bool versions::isDate (const std::string &version)
 
bool versions::isCoercibleToSemver (const std::string &version)
 
std::optional< std::string > versions::coerceSemver (std::string_view version)
 Attempt to coerce strings such as "v1.0.2" or 1.0 to valid semantic version strings.
 
bool versions::isSemverRange (const std::string &version)
 Determine if version is a valid semantic version range string.
 
std::pair< int, std::string > versions::runSemver (const std::list< std::string > &args)
 Invokes node-semver by exec.
 
static std::string versions::cleanRange (const std::string &range)
 Strip any '*', 'x', or 'X' characters from the range.
 
std::list< std::string > versions::semverSat (const std::string &range, const std::list< std::string > &versions)
 Filter a list of versions by a node-semver semantic version range.
 

Variables

static const char *const versions::semverREStr = "(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[-[:alnum:]_+.]+)?"
 
static const char *const versions::semverLooseREStr
 
static const char *const versions::semverCoerceREStr
 
static const char *const versions::dateREStr
 

Detailed Description

Interfaces used to perform version number analysis, especially Semantic Version processing.