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

Unified Diff: base/strings/string_util.h

Issue 1220793010: [ui/base;css] adding string template expression replacement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment change; merge with master Created 5 years, 5 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 | « no previous file | base/strings/string_util.cc » ('j') | base/strings/string_util.cc » ('J')
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 f5cf0b38db9c6ec1d09b59ccabee6e7968dc77f4..0c2d6b8e592a9e1246b3446aa5650aa6536b686f 100644
--- a/base/strings/string_util.h
+++ b/base/strings/string_util.h
@@ -10,6 +10,7 @@
#include <ctype.h>
#include <stdarg.h> // va_list
+#include <map>
#include <string>
#include <vector>
@@ -522,6 +523,13 @@ BASE_EXPORT base::string16 JoinString(
const std::vector<base::string16>& parts,
const base::string16& separator);
+// Replace ${foo} in the format string with the value for the foo key in
+// |subst|. Additionally, any number of consecutive '$' characters is replaced
+// by that number less one. Eg $$ becomes $, $$$ becomes $$, etc.
+BASE_EXPORT std::string ReplaceStringPlaceholders(
+ const std::string& format_string,
+ const std::map<std::string, std::string>& subst);
Evan Stade 2015/07/07 17:15:16 don't abbreviate variable names
Dan Beam 2015/07/07 17:26:37 yeah, i don't like it either. we could just fix t
+
// Replace $1-$2-$3..$9 in the format string with |a|-|b|-|c|..|i| respectively.
// Additionally, any number of consecutive '$' characters is replaced by that
// number less one. Eg $$->$, $$$->$$, etc. The offsets parameter here can be
« no previous file with comments | « no previous file | base/strings/string_util.cc » ('j') | base/strings/string_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698