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

Unified Diff: base/strings/string_util.h

Issue 1200393002: Add more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string
Patch Set: Android Created 5 years, 6 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 | « ash/system/user/login_status.cc ('k') | base/strings/string_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/string_util.h
diff --git a/base/strings/string_util.h b/base/strings/string_util.h
index 8b808681e2db05b801918d534b0c9d5dc073de00..dc3d4d762d117bd4169372997503d0f901335e65 100644
--- a/base/strings/string_util.h
+++ b/base/strings/string_util.h
@@ -417,28 +417,18 @@ inline bool IsUnicodeWhitespace(wchar_t c) {
// FormatBytes instead; remove this.
BASE_EXPORT string16 FormatBytesUnlocalized(int64 bytes);
-} // namespace base
-
-#if defined(OS_WIN)
-#include "base/strings/string_util_win.h"
-#elif defined(OS_POSIX)
-#include "base/strings/string_util_posix.h"
-#else
-#error Define string operations appropriately for your platform
-#endif
-
// Starting at |start_offset| (usually 0), replace the first instance of
// |find_this| with |replace_with|.
BASE_EXPORT void ReplaceFirstSubstringAfterOffset(
base::string16* str,
size_t start_offset,
- const base::string16& find_this,
- const base::string16& replace_with);
+ StringPiece16 find_this,
+ StringPiece16 replace_with);
BASE_EXPORT void ReplaceFirstSubstringAfterOffset(
std::string* str,
size_t start_offset,
- const std::string& find_this,
- const std::string& replace_with);
+ StringPiece find_this,
+ StringPiece replace_with);
// Starting at |start_offset| (usually 0), look through |str| and replace all
// instances of |find_this| with |replace_with|.
@@ -449,12 +439,23 @@ BASE_EXPORT void ReplaceFirstSubstringAfterOffset(
BASE_EXPORT void ReplaceSubstringsAfterOffset(
base::string16* str,
size_t start_offset,
- const base::string16& find_this,
- const base::string16& replace_with);
-BASE_EXPORT void ReplaceSubstringsAfterOffset(std::string* str,
- size_t start_offset,
- const std::string& find_this,
- const std::string& replace_with);
+ StringPiece16 find_this,
+ StringPiece16 replace_with);
+BASE_EXPORT void ReplaceSubstringsAfterOffset(
+ std::string* str,
+ size_t start_offset,
+ StringPiece find_this,
+ StringPiece replace_with);
+
+} // namespace base
+
+#if defined(OS_WIN)
+#include "base/strings/string_util_win.h"
+#elif defined(OS_POSIX)
+#include "base/strings/string_util_posix.h"
+#else
+#error Define string operations appropriately for your platform
+#endif
// Reserves enough memory in |str| to accommodate |length_with_null| characters,
// sets the size of |str| to |length_with_null - 1| characters, and returns a
« no previous file with comments | « ash/system/user/login_status.cc ('k') | base/strings/string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698