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

Unified Diff: base/string_number_conversions.cc

Issue 9296002: Add StringToSizeT to base/string_number_conversions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-land 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 41319b35fd66dbaad3d709416a0c22b3f45b5beb..e80b6499f2e04c0787a48d08f87b306e9fc3e468 100644
--- a/base/string_number_conversions.cc
+++ b/base/string_number_conversions.cc
@@ -426,6 +426,14 @@ bool StringToUint64(const StringPiece16& input, uint64* output) {
return String16ToIntImpl(input, output);
}
+bool StringToSizeT(const StringPiece& input, size_t* output) {
+ return StringToIntImpl(input, output);
+}
+
+bool StringToSizeT(const StringPiece16& input, size_t* 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