MCPcopy Create free account
hub / github.com/chrxh/alien / isVersionNewer

Method isVersionNewer

source/Base/VersionParserService.cpp:80–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80bool VersionParserService::isVersionNewer(std::string const& otherVersionString)
81{
82 auto otherParts = getVersionParts(otherVersionString);
83 auto ownParts = getVersionParts(Const::ProgramVersion);
84 if (otherParts.major > ownParts.major) {
85 return true;
86 }
87 if (otherParts.major < ownParts.major) {
88 return false;
89 }
90 if (otherParts.versionType > ownParts.versionType) {
91 return true;
92 }
93 if (otherParts.versionType < ownParts.versionType) {
94 return false;
95 }
96 if (otherParts.versionType == VersionType_Alpha || otherParts.versionType == VersionType_Beta) {
97 if (otherParts.preRelease > ownParts.preRelease) {
98 return true;
99 }
100 if (otherParts.preRelease < ownParts.preRelease) {
101 return false;
102 }
103 }
104 if (otherParts.versionType == VersionType_Release) {
105 if (otherParts.minor > ownParts.minor) {
106 return true;
107 }
108 if (otherParts.minor < ownParts.minor) {
109 return false;
110 }
111 if (otherParts.patch > ownParts.patch) {
112 return true;
113 }
114 if (otherParts.patch < ownParts.patch) {
115 return false;
116 }
117 }
118 return false;
119}

Callers 2

pushTextColorMethod · 0.80
onDownloadMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected