OpenMS
Loading...
Searching...
No Matches
VersionInfo.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Chris Bielow $
6// $Authors: Clemens Groepl, Chris Bielow $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
14namespace OpenMS
15{
16
35 class OPENMS_DLLAPI VersionInfo
36 {
37public:
38
47 struct OPENMS_DLLAPI VersionDetails
48 {
49 Int version_major = 0;
50 Int version_minor = 0;
51 Int version_patch = 0;
53
55 VersionDetails() = default;
56
58 VersionDetails(const VersionDetails & other) = default;
59
61 VersionDetails& operator=(const VersionDetails& other) = default;
62
82 static VersionDetails create(const std::string & version);
83
95 bool operator<(const VersionDetails & rhs) const;
102 bool operator==(const VersionDetails & rhs) const;
109 bool operator!=(const VersionDetails & rhs) const;
116 bool operator>(const VersionDetails & rhs) const;
117
119 static const VersionDetails EMPTY;
120 };
121
123 static std::string getTime();
124
126 static std::string getVersion();
127
130
142 static std::string getRevision();
143
155 static std::string getBranch();
156
157 };
158
159}
160
Version information class.
Definition VersionInfo.h:36
static VersionDetails getVersionStruct()
Return the version number of OpenMS.
static std::string getBranch()
Return the branch name from revision control system, e.g. git.
static std::string getTime()
Return the build time of OpenMS.
static std::string getVersion()
Return the version number of OpenMS.
static std::string getRevision()
Return the revision number from revision control system, e.g. git.
int Int
Signed integer type.
Definition Types.h:72
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Parsed semver-style version: major.minor.patch with an optional pre-release identifier.
Definition VersionInfo.h:48
bool operator!=(const VersionDetails &rhs) const
Field-wise inequality (the logical negation of operator==).
VersionDetails & operator=(const VersionDetails &other)=default
Copy assignment.
bool operator==(const VersionDetails &rhs) const
Field-wise equality on all four members, including string equality on the pre-release identifier.
static VersionDetails create(const std::string &version)
Parse a semver-style "X.Y[.Z[-PRE]]" string into the struct.
bool operator<(const VersionDetails &rhs) const
Compare two versions lexicographically by (major, minor, patch).
static const VersionDetails EMPTY
Sentinel 0.0.0 version used both as the default-constructed value and as the parse-failure return of ...
Definition VersionInfo.h:119
VersionDetails(const VersionDetails &other)=default
Copy constructor.
bool operator>(const VersionDetails &rhs) const
Equivalent to !(*this < rhs || *this == rhs); inherits the operator< caveat about pre-release ties.
VersionDetails()=default
Default-construct to 0.0.0 with an empty pre-release identifier (equivalent to EMPTY).
std::string pre_release_identifier
Pre-release suffix after a trailing '-' (everything to the end of the string); empty when no '-' is p...
Definition VersionInfo.h:52