| Index: base/version.cc
|
| diff --git a/base/version.cc b/base/version.cc
|
| index 3677b731980beb8328a1b6b0633c791cd1dee44e..19b9922e6922f8880868b1a11cd67956844d3bc0 100644
|
| --- a/base/version.cc
|
| +++ b/base/version.cc
|
| @@ -33,8 +33,6 @@ bool ParseVersionNumbers(const std::string& version_str,
|
| if (StartsWith(*it, "+", CompareCase::SENSITIVE))
|
| return false;
|
|
|
| - // TODO(brettw) when we have a StringPiece version of StringToUint, delete
|
| - // this string conversion.
|
| unsigned int num;
|
| if (!StringToUint(*it, &num))
|
| return false;
|
| @@ -107,13 +105,6 @@ bool Version::IsValidWildcardString(const std::string& wildcard_string) {
|
| return version.IsValid();
|
| }
|
|
|
| -bool Version::IsOlderThan(const std::string& version_str) const {
|
| - Version proposed_ver(version_str);
|
| - if (!proposed_ver.IsValid())
|
| - return false;
|
| - return (CompareTo(proposed_ver) < 0);
|
| -}
|
| -
|
| int Version::CompareToWildcardString(const std::string& wildcard_string) const {
|
| DCHECK(IsValid());
|
| DCHECK(Version::IsValidWildcardString(wildcard_string));
|
| @@ -151,12 +142,6 @@ int Version::CompareToWildcardString(const std::string& wildcard_string) const {
|
| return 0;
|
| }
|
|
|
| -bool Version::Equals(const Version& that) const {
|
| - DCHECK(IsValid());
|
| - DCHECK(that.IsValid());
|
| - return (CompareTo(that) == 0);
|
| -}
|
| -
|
| int Version::CompareTo(const Version& other) const {
|
| DCHECK(IsValid());
|
| DCHECK(other.IsValid());
|
| @@ -175,4 +160,32 @@ const std::string Version::GetString() const {
|
| return version_str;
|
| }
|
|
|
| +bool operator==(const Version& v1, const Version& v2) {
|
| + return v1.CompareTo(v2) == 0;
|
| +}
|
| +
|
| +bool operator!=(const Version& v1, const Version& v2) {
|
| + return !(v1 == v2);
|
| +}
|
| +
|
| +bool operator<(const Version& v1, const Version& v2) {
|
| + return v1.CompareTo(v2) < 0;
|
| +}
|
| +
|
| +bool operator<=(const Version& v1, const Version& v2) {
|
| + return v1.CompareTo(v2) <= 0;
|
| +}
|
| +
|
| +bool operator>(const Version& v1, const Version& v2) {
|
| + return v1.CompareTo(v2) > 0;
|
| +}
|
| +
|
| +bool operator>=(const Version& v1, const Version& v2) {
|
| + return v1.CompareTo(v2) >= 0;
|
| +}
|
| +
|
| +std::ostream& operator<<(std::ostream& stream, const Version& v) {
|
| + return stream << v.GetString();
|
| +}
|
| +
|
| } // namespace base
|
|
|