Polyphase Game Engine
Loading...
Searching...
No Matches
ReleaseInfo.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include <string>
6#include <vector>
7#include <cstdint>
8
12enum class PreReleaseType
13{
14 None = 0, // Stable release (highest precedence)
15 RC, // Release Candidate
16 Beta, // Beta (includes "beata" typo variant)
17 Alpha // Alpha (lowest precedence)
18};
19
23struct ReleaseAsset
24{
25 std::string mName; // e.g., "PolyphaseSetup-6.0.0.exe"
26 std::string mDownloadUrl; // Direct download URL
27 std::string mContentType; // e.g., "application/octet-stream"
28 size_t mSize = 0; // File size in bytes
29};
30
34struct ReleaseInfo
35{
36 std::string mTagName; // e.g., "v6.0.0"
37 std::string mName; // Release title, e.g., "Release 6.0.0"
38 std::string mBody; // Changelog/release notes (markdown)
39 std::string mHtmlUrl; // URL to GitHub release page
40 std::string mPublishedAt; // ISO timestamp
41 bool mPrerelease = false; // Whether this is a GitHub pre-release
42 std::vector<ReleaseAsset> mAssets;
43
48 std::string GetVersion() const
49 {
50 if (!mTagName.empty() && mTagName[0] == 'v')
51 {
52 return mTagName.substr(1);
53 }
54 return mTagName;
55 }
56
62 bool IsNewerThan(const std::string& currentVersion) const;
63
70 bool IsNewerThan(const std::string& currentVersion, bool cuttingEdgeEnabled) const;
71
76 const ReleaseAsset* GetAssetForPlatform() const;
77
86 static bool ParseVersion(const std::string& version, int& outMajor, int& outMinor, int& outPatch);
87
99 static bool ParseVersion(const std::string& version, int& outMajor, int& outMinor, int& outPatch,
100 int& outBuild, PreReleaseType& outPreReleaseType, int& outPreReleaseNum);
101};
102
103#endif // EDITOR