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

Unified Diff: base/string_util.h

Issue 6043: Added dangerous download prompting. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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
Index: base/string_util.h
===================================================================
--- base/string_util.h (revision 2758)
+++ base/string_util.h (working copy)
@@ -508,6 +508,14 @@
const std::wstring& d,
std::vector<size_t>* offsets);
+// If the size of |input| is more than |max_len|, this function returns true and
+// |input| is shortened into |output| by removing chars in the middle (they are
+// replaced with up to 3 dots, as size permits).
+// Ex: ElideString(L"Hello", 10, &str) puts Hello in str and returns false.
+// ElideString(L"Hello my name is Tom", 10, &str) puts "Hell...Tom" in str and
+// returns true.
+bool ElideString(const std::wstring& input, int max_len, std::wstring* output);
+
// Returns true if the string passed in matches the pattern. The pattern
// string can contain wildcards like * and ?
// TODO(iyengar) This function may not work correctly for CJK strings as

Powered by Google App Engine
This is Rietveld 408576698