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
12
13#include <string>
14
15namespace OpenMS
16{
17
36 class OPENMS_DLLAPI VersionInfo
37 {
38public:
39
48 struct OPENMS_DLLAPI VersionDetails
49 {
50 Int version_major = 0;
51 Int version_minor = 0;
52 Int version_patch = 0;
54
56 VersionDetails() = default;
57
59 VersionDetails(const VersionDetails & other) = default;
60
62 VersionDetails& operator=(const VersionDetails& other) = default;
63
83 static VersionDetails create(const std::string & version);
84
96 bool operator<(const VersionDetails & rhs) const;
103 bool operator==(const VersionDetails & rhs) const;
110 bool operator!=(const VersionDetails & rhs) const;
117 bool operator>(const VersionDetails & rhs) const;
118
120 static const VersionDetails EMPTY;
121 };
122
124 static std::string getTime();
125
127 static std::string getVersion();
128
131
143 static std::string getRevision();
144
156 static std::string getBranch();
157
158 };
159
160}
161
Version information class.
Definition VersionInfo.h:37
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:49
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:120
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:53