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

Unified Diff: base/string_number_conversions.cc

Issue 9288012: Add StringToUint and StringToUint64 methods to base/string_number_conversions.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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_number_conversions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_number_conversions.cc
diff --git a/base/string_number_conversions.cc b/base/string_number_conversions.cc
index 1d82c5d638403df1145353122279dbca2be7180c..41319b35fd66dbaad3d709416a0c22b3f45b5beb 100644
--- a/base/string_number_conversions.cc
+++ b/base/string_number_conversions.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -402,6 +402,14 @@ bool StringToInt(const StringPiece16& input, int* output) {
return String16ToIntImpl(input, output);
}
+bool StringToUint(const StringPiece& input, unsigned* output) {
+ return StringToIntImpl(input, output);
+}
+
+bool StringToUint(const StringPiece16& input, unsigned* output) {
+ return String16ToIntImpl(input, output);
+}
+
bool StringToInt64(const StringPiece& input, int64* output) {
return StringToIntImpl(input, output);
}
@@ -410,6 +418,14 @@ bool StringToInt64(const StringPiece16& input, int64* output) {
return String16ToIntImpl(input, output);
}
+bool StringToUint64(const StringPiece& input, uint64* output) {
+ return StringToIntImpl(input, output);
+}
+
+bool StringToUint64(const StringPiece16& input, uint64* output) {
+ return String16ToIntImpl(input, output);
+}
+
bool StringToDouble(const std::string& input, double* output) {
errno = 0; // Thread-safe? It is on at least Mac, Linux, and Windows.
char* endptr = NULL;
« no previous file with comments | « base/string_number_conversions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698