1 #ifndef VERSIONCHECKER_H_
2 #define VERSIONCHECKER_H_
7 #include "Config/Version.h"
8 #include "../Utils/Logging.h"
10 using json = nlohmann::json;
40 int parsedCurrent[3], parsedOther[3];
43 return std::lexicographical_compare(parsedCurrent, parsedCurrent + 3, parsedOther, parsedOther + 3);
55 std::istringstream parser(input);
57 for(
int idx = 1; idx < 3; idx++)
60 parser >> result[idx];
78 bool CheckForUpdates(std::string repository, std::string currentVersion);
89 static size_t receiveData(
void* contents,
size_t size,
size_t nmemb, std::string* tags);
129 #endif // VERSIONCHECKER_H_
Compares string versions.
Definition: VersionChecker.h:29
bool PreRelease
Is pre-release?.
Definition: VersionChecker.h:22
static void parseVersion(int result[3], const std::string &input)
Definition: VersionChecker.h:53
bool CheckForUpdates(std::string repository, std::string currentVersion)
Returns whether there are updates available.
Definition: VersionChecker.cpp:3
Checks Mania++ version (and possibly plugin versions).
Definition: VersionChecker.h:69
void retrieveData(std::string url, std::string *data)
Retrieves data via cURL.
Definition: VersionChecker.cpp:96
void decodeRelease(GitVersion *version, std::string response)
Decodes the JSON response with release and inputs info into version struct.
Definition: VersionChecker.cpp:157
std::string Tag
Tag version.
Definition: VersionChecker.h:19
std::vector< GitVersion > retrieveVersions(std::string repository)
Retrieves versions (tags) of repository.
Definition: VersionChecker.cpp:120
static bool NewerThanCurrent(const std::string ¤t, const std::string &other)
Definition: VersionChecker.h:38
static size_t receiveData(void *contents, size_t size, size_t nmemb, std::string *tags)
Receives data from cURL input.
Definition: VersionChecker.cpp:78
std::vector< GitVersion > decodeVersions(std::string response)
Decodes the JSON response with versions (tags) of repository.
Definition: VersionChecker.cpp:128
void retrieveRelease(GitVersion *version)
Retrieves release information.
Definition: VersionChecker.cpp:149
std::string Repository
Name of the GitHub repository.
Definition: VersionChecker.h:18
Contains information about a Git release (version).
Definition: VersionChecker.h:16
std::string Commit
SHA commit.
Definition: VersionChecker.h:21
std::string Name
Tag name (description).
Definition: VersionChecker.h:20