|
Leosac
0.8.0
Open Source Access Control
|
Go to the documentation of this file.
29 #include <boost/regex.hpp>
30 #include <spdlog/fmt/fmt.h>
37 std::ostringstream oss;
39 oss << major <<
'.' << minor <<
'.' << patch;
40 if (!git_sha1.empty())
41 oss <<
"-" << git_sha1;
45 static void cleanVersionString(std::string &v)
47 v = v.substr(0, v.find_first_of(
'-'));
48 std::replace(v.begin(), v.end(),
'.',
' ');
53 std::istringstream issa;
54 std::istringstream issb;
58 cleanVersionString(a);
59 cleanVersionString(b);
62 for (
int i = 0; i < 3; ++i)
76 boost::regex r(
"[0-9]+\\.[0-9]+\\.[0-9]+($|\\-[a-f0-9]{40}$)");
77 return boost::regex_match(v, r);