Chromium Code Reviews| 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 |