diff --git a/headers/os/package/PackageVersion.h b/headers/os/package/PackageVersion.h index f8b78b1b28..5333158c72 100644 --- a/headers/os/package/PackageVersion.h +++ b/headers/os/package/PackageVersion.h @@ -51,6 +51,13 @@ public: // does a natural compare over major, minor // and micro, finally comparing revision + inline bool operator==(const BPackageVersion& other) const; + inline bool operator!=(const BPackageVersion& other) const; + inline bool operator<(const BPackageVersion& other) const; + inline bool operator>(const BPackageVersion& other) const; + inline bool operator<=(const BPackageVersion& other) const; + inline bool operator>=(const BPackageVersion& other) const; + private: BString fMajor; BString fMinor; @@ -60,6 +67,48 @@ private: }; +inline bool +BPackageVersion::operator==(const BPackageVersion& other) const +{ + return Compare(other) == 0; +} + + +inline bool +BPackageVersion::operator!=(const BPackageVersion& other) const +{ + return Compare(other) != 0; +} + + +inline bool +BPackageVersion::operator<(const BPackageVersion& other) const +{ + return Compare(other) < 0; +} + + +inline bool +BPackageVersion::operator>(const BPackageVersion& other) const +{ + return Compare(other) > 0; +} + + +inline bool +BPackageVersion::operator<=(const BPackageVersion& other) const +{ + return Compare(other) <= 0; +} + + +inline bool +BPackageVersion::operator>=(const BPackageVersion& other) const +{ + return Compare(other) >= 0; +} + + } // namespace BPackageKit