OpenCPN Partial API docs
Loading...
Searching...
No Matches
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. More...
 
 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. More...
 

Static Public Member Functions

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

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.

Constructor & Destructor Documentation

◆ SemanticVersion() [1/2]

SemanticVersion::SemanticVersion ( )

Construct a "0.0.0.0" version.

Definition at line 59 of file semantic_vers.cpp.

◆ SemanticVersion() [2/2]

SemanticVersion::SemanticVersion ( int  major,
int  minor,
int  rev = 0,
int  post = 0,
std::string  pre = "",
std::string  build = "" 
)

Definition at line 62 of file semantic_vers.cpp.

Member Function Documentation

◆ operator!=()

bool SemanticVersion::operator!= ( const SemanticVersion other)

Definition at line 97 of file semantic_vers.cpp.

◆ operator<()

bool SemanticVersion::operator< ( const SemanticVersion other)

Definition at line 72 of file semantic_vers.cpp.

◆ operator<=()

bool SemanticVersion::operator<= ( const SemanticVersion other)

Definition at line 89 of file semantic_vers.cpp.

◆ operator==()

bool SemanticVersion::operator== ( const SemanticVersion other)

Definition at line 80 of file semantic_vers.cpp.

◆ operator>()

bool SemanticVersion::operator> ( const SemanticVersion other)

Definition at line 85 of file semantic_vers.cpp.

◆ operator>=()

bool SemanticVersion::operator>= ( const SemanticVersion other)

Definition at line 93 of file semantic_vers.cpp.

◆ parse()

SemanticVersion SemanticVersion::parse ( std::string  s)
static

Parse a version string, sets major == -1 on errors.

Definition at line 37 of file semantic_vers.cpp.

◆ to_string()

std::string SemanticVersion::to_string ( )

Return printable representation.

Definition at line 121 of file semantic_vers.cpp.

Member Data Documentation

◆ build

std::string SemanticVersion::build

Definition at line 57 of file semantic_vers.h.

◆ major

int SemanticVersion::major

Definition at line 52 of file semantic_vers.h.

◆ minor

int SemanticVersion::minor

Definition at line 53 of file semantic_vers.h.

◆ patch

int SemanticVersion::patch

Definition at line 54 of file semantic_vers.h.

◆ post

int SemanticVersion::post

Definition at line 55 of file semantic_vers.h.

◆ pre

std::string SemanticVersion::pre

Definition at line 56 of file semantic_vers.h.


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