34 std::vector<std::string>
splitString(std::string input,
const std::string& delimiter)
36 std::vector<std::string> result;
38 std::string substring;
39 while ((pos = input.find(delimiter)) != std::string::npos)
41 substring = input.substr(0, pos);
42 result.push_back(substring);
43 input.erase(0, pos + delimiter.length());
45 result.push_back(input);
63 if (components.size() >= 2)
65 info.
major = std::stoi(components[0]);
66 info.
minor = std::stoi(components[1]);
67 if (components.size() >= 3)
69 info.
bugfix = std::stoi(components[2]);
70 if (components.size() == 4)
72 info.
build = std::stoi(components[3]);
74 else if (components.size() > 4)
76 throw UrException(
"Given string '" + str +
"' does not conform a version string format.");
82 throw UrException(
"Given string '" + str +
"' does not conform a version string format.");
90 return this->
major >= 5;
135 return v1 < v2 || v1 == v2;
std::vector< std::string > splitString(std::string input, const std::string &delimiter=".")
Our base class for exceptions. Specialized exceptions should inherit from those.