Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3472)

Unified Diff: base/version.cc

Issue 3056029: Move the number conversions from string_util to a new file.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/string_util_unittest.cc ('k') | chrome/app/chrome_dll_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/version.cc
===================================================================
--- base/version.cc (revision 54340)
+++ base/version.cc (working copy)
@@ -5,13 +5,15 @@
#include "base/version.h"
#include "base/logging.h"
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
// static
Version* Version::GetVersionFromString(const std::wstring& version_str) {
if (!IsStringASCII(version_str))
return NULL;
- return GetVersionFromString(WideToASCII(version_str));
+ return GetVersionFromString(WideToUTF8(version_str));
}
// static
@@ -60,10 +62,10 @@
std::string version_str;
int count = components_.size();
for (int i = 0; i < count - 1; ++i) {
- version_str.append(IntToString(components_[i]));
+ version_str.append(base::IntToString(components_[i]));
version_str.append(".");
}
- version_str.append(IntToString(components_[count - 1]));
+ version_str.append(base::IntToString(components_[count - 1]));
return version_str;
}
@@ -76,7 +78,7 @@
for (std::vector<std::string>::iterator i = numbers.begin();
i != numbers.end(); ++i) {
int num;
- if (!StringToInt(*i, &num))
+ if (!base::StringToInt(*i, &num))
return false;
if (num < 0)
return false;
@@ -84,7 +86,7 @@
if (num > max)
return false;
// This throws out things like +3, or 032.
- if (IntToString(num) != *i)
+ if (base::IntToString(num) != *i)
return false;
uint16 component = static_cast<uint16>(num);
components_.push_back(component);
« no previous file with comments | « base/string_util_unittest.cc ('k') | chrome/app/chrome_dll_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698