mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
Snapshots: Disable activation of incompatible snapshots
This commit is contained in:
parent
df3e84d580
commit
bbc3c890ea
5 changed files with 38 additions and 30 deletions
|
@ -4,6 +4,7 @@
|
|||
#include <string>
|
||||
#include <cstring>
|
||||
#include <ostream>
|
||||
#include <stdexcept>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/format.hpp>
|
||||
|
||||
|
@ -33,6 +34,16 @@ public:
|
|||
set_prerelease(prerelease);
|
||||
}
|
||||
|
||||
Semver(const std::string &str) : ver(semver_zero())
|
||||
{
|
||||
auto parsed = parse(str);
|
||||
if (! parsed) {
|
||||
throw std::runtime_error(std::string("Could not parse version string: ") + str);
|
||||
}
|
||||
ver = parsed->ver;
|
||||
parsed->ver = semver_zero();
|
||||
}
|
||||
|
||||
static boost::optional<Semver> parse(const std::string &str)
|
||||
{
|
||||
semver_t ver = semver_zero();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue