| 244 | } |
| 245 | |
| 246 | int |
| 247 | BundleVersion::Compare(BundleVersion const& other) const |
| 248 | { |
| 249 | if (&other == this) |
| 250 | { // quicktest |
| 251 | return 0; |
| 252 | } |
| 253 | |
| 254 | if (this->undefined || other.undefined) |
| 255 | throw std::logic_error("Cannot compare undefined version"); |
| 256 | |
| 257 | if (majorVersion < other.majorVersion) |
| 258 | { |
| 259 | return -1; |
| 260 | } |
| 261 | |
| 262 | if (majorVersion == other.majorVersion) |
| 263 | { |
| 264 | |
| 265 | if (minorVersion < other.minorVersion) |
| 266 | { |
| 267 | return -1; |
| 268 | } |
| 269 | |
| 270 | if (minorVersion == other.minorVersion) |
| 271 | { |
| 272 | |
| 273 | if (microVersion < other.microVersion) |
| 274 | { |
| 275 | return -1; |
| 276 | } |
| 277 | |
| 278 | if (microVersion == other.microVersion) |
| 279 | { |
| 280 | return qualifier.compare(other.qualifier); |
| 281 | } |
| 282 | } |
| 283 | } |
| 284 | return 1; |
| 285 | } |
| 286 | |
| 287 | std::ostream& |
| 288 | operator<<(std::ostream& os, BundleVersion const& v) |