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

Unified Diff: base/string_util.h

Issue 8502027: Fix AutocompleteMatch DCHECK() triggered by |RenderViewContextMenu::AppendSearchProvider()|. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | « no previous file | base/string_util.cc » ('j') | base/string_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util.h
===================================================================
--- base/string_util.h (revision 108864)
+++ base/string_util.h (working copy)
@@ -173,9 +173,9 @@
BASE_EXPORT extern const char kUtf8ByteOrderMark[];
-// Removes characters in |remove_chars| from anywhere in input. Returns true if
-// any characters were removed. |remove_chars| must be null-terminated.
-// NOTE: Safe to use the same variable for both input and output.
+// Removes characters in |remove_chars| from anywhere in |input|. Returns true
+// if any characters were removed. |remove_chars| must be null-terminated.
+// NOTE: Safe to use the same variable for both |input| and |output|.
BASE_EXPORT bool RemoveChars(const string16& input,
const char16 remove_chars[],
string16* output);
@@ -183,9 +183,22 @@
const char remove_chars[],
std::string* output);
-// Removes characters in |trim_chars| from the beginning and end of input.
+// Replaces characters in |replace_chars| from anywhere in |input| with
+// |replace_with|. Returns true if any characters were removed.
Mark Mentovai 2011/11/09 20:31:32 Removed? Replaced!
Mark Mentovai 2011/11/09 20:31:32 This doesn’t really explain whether ReplaceChars r
Alexei Svitkine (slow) 2011/11/09 21:03:58 Done.
Alexei Svitkine (slow) 2011/11/09 21:03:58 Done.
+// |replace_chars| must be null-terminated.
+// NOTE: Safe to use the same variable for both |input| and |output|.
+BASE_EXPORT bool ReplaceChars(const string16& input,
+ const char16 replace_chars[],
+ const string16& replace_with,
+ string16* output);
+BASE_EXPORT bool ReplaceChars(const std::string& input,
+ const char replace_chars[],
+ const std::string& replace_with,
+ std::string* output);
+
+// Removes characters in |trim_chars| from the beginning and end of |input|.
// |trim_chars| must be null-terminated.
-// NOTE: Safe to use the same variable for both input and output.
+// NOTE: Safe to use the same variable for both |input| and |output|.
BASE_EXPORT bool TrimString(const std::wstring& input,
const wchar_t trim_chars[],
std::wstring* output);
« no previous file with comments | « no previous file | base/string_util.cc » ('j') | base/string_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698