Returns whether version part p1 is earlier than p2. */
| 590 | |
| 591 | /** Returns whether version part p1 is earlier than p2. */ |
| 592 | static bool compareVersionPart(const std::string& p1, const std::string& p2) { |
| 593 | int i1 = stringToInt(p1); |
| 594 | int i2 = stringToInt(p2); |
| 595 | |
| 596 | if (i1 >= 0 && i2 >= 0) { |
| 597 | // Compare integers. |
| 598 | return i1 < i2; |
| 599 | } |
| 600 | else if (i1 < 0 && i2 < 0) { |
| 601 | // Compare strings. |
| 602 | return p1 < p2; |
| 603 | } |
| 604 | else { |
| 605 | // Types are different. String is always less than int. |
| 606 | return i1 < 0; |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | |
| 611 | Version::Version(const std::string& s) { |
nothing calls this directly
no test coverage detected