PowerToys/src/common/version/helper.h
Andrey Nekrasov 05f12dcdf1
[Updating] Add versioning to UpdateState.json (#12744)
- fix "Check for updates" hang if UpdateState.json was deleted while the page is open
2021-08-12 14:53:51 +03:00

23 lines
520 B
C++

#pragma once
#include <string>
#include <optional>
#include <compare>
struct VersionHelper
{
VersionHelper(const size_t major, const size_t minor, const size_t revision);
auto operator<=>(const VersionHelper&) const = default;
static std::optional<VersionHelper> fromString(std::string_view s);
static std::optional<VersionHelper> fromString(std::wstring_view s);
size_t major;
size_t minor;
size_t revision;
std::wstring toWstring() const;
std::string toString() const;
};