1 #ifndef CPP_SEMVER_TYPE_HPP 2 #define CPP_SEMVER_TYPE_HPP 13 semver_error(
const std::string& msg) : std::runtime_error(msg) {}
43 eq, lt, lte, gt, gte, tilde, caret
50 explicit xnumber(
const int& val) : is_wildcard(false),
value(val) {}
68 std::string build =
"";
70 comparator cmp = comparator::eq;
77 bool as_hyphon =
false;
78 std::vector< simple > and_set;
84 std::vector< range > or_set;
118 bool from_inclusive =
true;
119 bool to_inclusive =
true;
127 std::vector< interval > or_set;
133 return (lhs.major == rhs.major) &&
134 (lhs.minor == rhs.minor) &&
135 (lhs.patch == rhs.patch) &&
136 (lhs.pre == rhs.pre) &&
137 (lhs.is_max == rhs.is_max);
142 return !(lhs == rhs);
150 if (lhs.is_max || rhs.is_max)
151 return !lhs.is_max && rhs.is_max;
153 if (lhs.major < rhs.major)
156 if ((lhs.major == rhs.major) &&
157 (lhs.minor < rhs.minor))
160 if ((lhs.major == rhs.major) &&
161 (lhs.minor == rhs.minor) &&
162 (lhs.patch < rhs.patch))
166 if ((lhs.major == rhs.major) &&
167 (lhs.minor == rhs.minor) &&
168 (lhs.patch == rhs.patch) &&
169 (!lhs.pre.empty() && rhs.pre.empty()))
173 if ((lhs.major == rhs.major) &&
174 (lhs.minor == rhs.minor) &&
175 (lhs.patch == rhs.patch) &&
176 (!lhs.pre.empty() && !rhs.pre.empty()) &&
185 return (lhs != rhs) && !(lhs < rhs);
190 return (lhs < rhs) || (lhs == rhs);
195 return (lhs > rhs) || (lhs == rhs);
200 return (lhs.from_inclusive == rhs.from_inclusive) &&
201 (lhs.to_inclusive == rhs.to_inclusive) &&
202 (lhs.from == rhs.from) &&
208 return !(lhs == rhs);
213 if (lhs.to < rhs.from ||
214 (lhs.to == rhs.from && (!lhs.to_inclusive || !rhs.from_inclusive)))
221 return (lhs < rhs) || (lhs == rhs);
226 return (lhs != rhs) && !(lhs < rhs);
231 return (lhs > rhs) || (lhs == rhs);
union set (i.e. OR conjunction )
Definition: type.hpp:82
xnumber()
represents '*'
Definition: type.hpp:53
Definition: generic.hpp:135
static boundary max()
Represent a maximal version boundary.
Definition: type.hpp:107
xnumber(const int &val)
represents an integer
Definition: type.hpp:50
static boundary min()
Represent a minimal version boundary.
Definition: type.hpp:101
interval set (i.e. OR conjunction )
Definition: type.hpp:125
default interval is *.*.* := [min, max]
Definition: type.hpp:116
represents any type of 'simple', 'primitive', 'partial', 'tilde' or 'caret' from the grammar...
Definition: type.hpp:61
an integer or wildcard
Definition: type.hpp:47