OpenCPN Partial API docs
SemanticVersion Struct Reference

Versions uses a modified semantic versioning scheme: major.minor.revision.post-tag+build. More...

#include <semantic_vers.h>

Public Member Functions

 SemanticVersion ()
 Construct a "0.0.0.0" version.
 
 SemanticVersion (int major, int minor, int rev=0, int post=0, std::string pre="", std::string build="")
 
bool operator< (const SemanticVersion &other)
 
bool operator== (const SemanticVersion &other)
 
bool operator> (const SemanticVersion &other)
 
bool operator<= (const SemanticVersion &other)
 
bool operator>= (const SemanticVersion &other)
 
bool operator!= (const SemanticVersion &other)
 
std::string to_string ()
 Return printable representation.
 

Static Public Member Functions

static SemanticVersion parse (std::string s)
 Parse a version string, sets major == -1 on errors.
 

Public Attributes

int major
 
int minor
 
int patch
 
int post
 
std::string pre
 
std::string build
 

Detailed Description

Versions uses a modified semantic versioning scheme: major.minor.revision.post-tag+build.

for example 1.2.6.1-alfa+deadbee. The values major, minor, revision and post should be integers. The tag is a pre-release marker, the build part is build info.

Parsing and comparing follows the spec besides

  • the pre-release tag which is sorted strictly lexically (no dotted parts or numeric ordering support).
  • The post part which is post-release number, typically used in downstream releases.

See: https://semver.org/

Definition at line 51 of file semantic_vers.h.


The documentation for this struct was generated from the following files: