Chromium Code Reviews| Index: base/strings/string_util.h |
| diff --git a/base/strings/string_util.h b/base/strings/string_util.h |
| index dc3d4d762d117bd4169372997503d0f901335e65..f57bc09c80d7c1ba3ff7ee771063edd232f10268 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> |
| @@ -518,6 +519,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. |
|
Dan Beam
2015/07/02 02:10:16
subst -> |subst|
dschuyler
2015/07/07 23:05:30
Done.
|
| +// 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); |
| + |
| // 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 |