2020-02-25 16:44:13 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2021-08-12 19:53:51 +08:00
|
|
|
#include <optional>
|
2020-04-04 00:51:28 +08:00
|
|
|
#include <compare>
|
2020-02-25 16:44:13 +08:00
|
|
|
|
|
|
|
struct VersionHelper
|
|
|
|
{
|
2020-08-26 20:03:53 +08:00
|
|
|
VersionHelper(const size_t major, const size_t minor, const size_t revision);
|
2020-02-25 16:44:13 +08:00
|
|
|
|
2020-04-04 00:51:28 +08:00
|
|
|
auto operator<=>(const VersionHelper&) const = default;
|
2021-08-12 19:53:51 +08:00
|
|
|
|
|
|
|
static std::optional<VersionHelper> fromString(std::string_view s);
|
|
|
|
static std::optional<VersionHelper> fromString(std::wstring_view s);
|
2020-02-25 16:44:13 +08:00
|
|
|
|
2020-08-26 20:03:53 +08:00
|
|
|
size_t major;
|
|
|
|
size_t minor;
|
|
|
|
size_t revision;
|
2020-04-27 18:39:47 +08:00
|
|
|
|
|
|
|
std::wstring toWstring() const;
|
2021-03-17 21:49:07 +08:00
|
|
|
std::string toString() const;
|
2020-02-25 16:44:13 +08:00
|
|
|
};
|