20 #ifndef LIBREPCB_CORE_VERSION_H 21 #define LIBREPCB_CORE_VERSION_H 28 #include <optional.hpp> 109 QString
toStr()
const noexcept;
123 QString
toPrettyStr(
int minSegCount,
int maxSegCount = 10)
const noexcept;
182 static bool isValid(
const QString& str) noexcept;
205 static tl::optional<Version>
tryFromString(
const QString& str) noexcept;
bool operator<=(const Version &rhs) const noexcept
Comparison operators.
Definition: version.h:161
static bool isValid(const QString &str) noexcept
Check if a string is a valid version number.
Definition: version.cpp:85
The Version class represents a version number in the format "1.42.7".
Definition: version.h:58
Definition: occmodel.cpp:76
bool operator>=(const Version &rhs) const noexcept
Comparison operators.
Definition: version.h:158
Version()=delete
Default constructor (disabled to avoid creating invalid versions)
Version & operator=(const Version &rhs) noexcept
Definition: version.h:139
bool isPrefixOf(const Version &other) const noexcept
Check if this version is the prefix of another version.
Definition: version.cpp:39
~Version() noexcept=default
bool operator==(const Version &rhs) const noexcept
Comparison operators.
Definition: version.h:164
QVector< uint > mNumbers
List of all version numbers of the whole version.
Definition: version.h:216
Version(const Version &other) noexcept
Copy constructor.
Definition: version.h:74
QString toStr() const noexcept
Get the version as a string in the format "1.2.3".
Definition: version.cpp:52
QString toPrettyStr(int minSegCount, int maxSegCount=10) const noexcept
Get the version as a string with trailing zeros (e.g. "1.2.0")
Definition: version.cpp:56
const QVector< uint > & getNumbers() const noexcept
Get the numbers in the version string.
Definition: version.h:102
bool operator<(const Version &rhs) const noexcept
Comparison operators.
Definition: version.h:155
bool operator>(const Version &rhs) const noexcept
Comparison operators.
Definition: version.h:152
static tl::optional< Version > tryFromString(const QString &str) noexcept
Try creating a Version object from a string, returning empty optional if invalid. ...
Definition: version.cpp:101
bool operator!=(const Version &rhs) const noexcept
Comparison operators.
Definition: version.h:167
static Version fromString(const QString &str)
Create a Version object from a string.
Definition: version.cpp:90
Version(const QVector< uint > &numbers) noexcept
Definition: version.h:208
QString toComparableStr() const noexcept
Get the version as a comparable string (59 characters)
Definition: version.cpp:68