diff options
author | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-17 00:28:03 +0000 |
---|---|---|
committer | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-17 00:28:03 +0000 |
commit | 680d201ec4f79642cca4073145fdb86e809eb03c (patch) | |
tree | 2d90a0f932cffb68277d65152eedd7c6e5f35d4f /base | |
parent | bf94d1a4cee4be0648778022f27100f8a074e34a (diff) | |
download | chromium_src-680d201ec4f79642cca4073145fdb86e809eb03c.zip chromium_src-680d201ec4f79642cca4073145fdb86e809eb03c.tar.gz chromium_src-680d201ec4f79642cca4073145fdb86e809eb03c.tar.bz2 |
Revert 69490 - base/version: remove wstring version
And fix callers.
BUG=23581
TEST=trybots
Review URL: http://codereview.chromium.org/5848005
TBR=evan@chromium.org
Review URL: http://codereview.chromium.org/5905006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69491 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/version.cc | 7 | ||||
-rw-r--r-- | base/version.h | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/base/version.cc b/base/version.cc index c25b293..fe224eb 100644 --- a/base/version.cc +++ b/base/version.cc @@ -11,6 +11,13 @@ #include "base/utf_string_conversions.h" // static +Version* Version::GetVersionFromString(const std::wstring& version_str) { + if (!IsStringASCII(version_str)) + return NULL; + return GetVersionFromString(WideToUTF8(version_str)); +} + +// static Version* Version::GetVersionFromString(const std::string& version_str) { Version* vers = new Version(); if (vers->InitFromString(version_str)) { diff --git a/base/version.h b/base/version.h index 33f4af5..2b182bb 100644 --- a/base/version.h +++ b/base/version.h @@ -12,14 +12,12 @@ #include "base/basictypes.h" #include "base/gtest_prod_util.h" -// Version represents a dotted version number, like "1.2.3.4", supporting -// parsing and comparison. -// Each component is limited to a uint16. class Version { public: // The version string must be made up of 1 or more uint16's separated // by '.'. Returns NULL if string is not in this format. // Caller is responsible for freeing the Version object once done. + static Version* GetVersionFromString(const std::wstring& version_str); static Version* GetVersionFromString(const std::string& version_str); // Exposed only so that a Version can be stored in STL containers; |