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;
The Version class represents a version number in the format "1.42.7".
Definition: version.h:58
QVector< uint > mNumbers
List of all version numbers of the whole version.
Definition: version.h:216
bool isPrefixOf(const Version &other) const noexcept
Check if this version is the prefix of another version.
Definition: version.cpp:40
const QVector< uint > & getNumbers() const noexcept
Get the numbers in the version string.
Definition: version.h:102
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:53
bool operator>=(const Version &rhs) const noexcept
Definition: version.h:158
Version(const QVector< uint > &numbers) noexcept
Definition: version.h:208
bool operator==(const Version &rhs) const noexcept
Definition: version.h:164
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:102
bool operator!=(const Version &rhs) const noexcept
Definition: version.h:167
Version()=delete
Default constructor (disabled to avoid creating invalid versions)
bool operator>(const Version &rhs) const noexcept
Comparison operators.
Definition: version.h:152
QString toComparableStr() const noexcept
Get the version as a comparable string (59 characters)
Definition: version.cpp:69
~Version() noexcept=default
static Version fromString(const QString &str)
Create a Version object from a string.
Definition: version.cpp:91
static bool isValid(const QString &str) noexcept
Check if a string is a valid version number.
Definition: version.cpp:86
bool operator<=(const Version &rhs) const noexcept
Definition: version.h:161
bool operator<(const Version &rhs) const noexcept
Definition: version.h:155
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:57
Definition: occmodel.cpp:77