summaryrefslogtreecommitdiffstats
path: root/base/version.h
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-01 17:45:08 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-01 17:45:08 +0000
commit30c157c0312dd978500c5ede8cc06849b4c13f77 (patch)
tree6eecfd36dcb7bc33f71b60103a6f2d8877c5ad96 /base/version.h
parentf5fe361a09af8005f0553557d91274339bc20755 (diff)
downloadchromium_src-30c157c0312dd978500c5ede8cc06849b4c13f77.zip
chromium_src-30c157c0312dd978500c5ede8cc06849b4c13f77.tar.gz
chromium_src-30c157c0312dd978500c5ede8cc06849b4c13f77.tar.bz2
Add a convenience function to Version
Came up as in item in a component updater review. It is a common pattern used in extension updater and component updater. TEST=included BUG=none Review URL: http://codereview.chromium.org/7541015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94928 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/version.h')
-rw-r--r--base/version.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/version.h b/base/version.h
index e03b01a..b61cbb5 100644
--- a/base/version.h
+++ b/base/version.h
@@ -31,6 +31,12 @@ class BASE_API Version {
// Returns true if the object contains a valid version number.
bool IsValid() const;
+ // Commonly used pattern. Given a valid version object, compare if a
+ // |version_str| results in a newer version. Returns true if the
+ // string represents valid version and if the version is greater than
+ // than the version of this object.
+ bool IsOlderThan(const std::string& version_str) const;
+
// Returns NULL if the string is not in the proper format.
// Caller is responsible for freeing the Version object once done.
// DO NOT USE FOR NEWER CODE.