MCPcopy Create free account
hub / github.com/LAStools/LAStools / compareVersions

Function compareVersions

src/proj_loader.cpp:134–145  ·  view source on GitHub ↗

Compare lib version numbers. Return ture if v1 latest version

Source from the content-addressed store, hash-verified

132
133/// Compare lib version numbers. Return ture if v1 latest version
134static bool compareVersions(std::string v1, std::string v2) {
135 std::vector<int> version1 = parseVersion(v1);
136 std::vector<int> version2 = parseVersion(v2);
137
138 size_t len = std::min(version1.size(), version2.size());
139 for (size_t i = 0; i < len; ++i) {
140 if (version1[i] > version2[i]) return true;
141 if (version1[i] < version2[i]) return false;
142 }
143
144 return version1.size() > version2.size();
145}
146
147/// Finds the latest PROJ library within the installation path
148static std::string findLatestProjLibraryPath(const std::string& path) {

Callers 5

load_proj_libraryFunction · 0.85

Calls 2

parseVersionFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected