diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 22:40:57 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 22:40:57 +0000 |
commit | dff6d13ca6ddb778867ce2d731d5f8093aef28ea (patch) | |
tree | 4758c346a2af607ec2a842c24f222e8fc401b6a8 /base/string_util.h | |
parent | 05062e288e4b8f174a79cc698c3c97d7d12975be (diff) | |
download | chromium_src-dff6d13ca6ddb778867ce2d731d5f8093aef28ea.zip chromium_src-dff6d13ca6ddb778867ce2d731d5f8093aef28ea.tar.gz chromium_src-dff6d13ca6ddb778867ce2d731d5f8093aef28ea.tar.bz2 |
Re-land of earlier NTP theme patch; now with mac and linux compatibility.
Review URL: http://codereview.chromium.org/115413
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util.h')
-rw-r--r-- | base/string_util.h | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/base/string_util.h b/base/string_util.h index 7df1d92..cb71553 100644 --- a/base/string_util.h +++ b/base/string_util.h @@ -558,30 +558,17 @@ std::string JoinString(const std::vector<std::string>& parts, char s); void SplitStringAlongWhitespace(const std::wstring& str, std::vector<std::wstring>* result); -// Replace $1-$2-$3 in the format string with |a| and |b| respectively. -// Additionally, $$ is replaced by $. The offset/offsets parameter here can be -// NULL. +// Replace $1-$2-$3..$9 in the format string with |a|-|b|-|c|..|i| respectively. +// Additionally, $$ is replaced by $. The offsets parameter here can +// be NULL. This only allows you to use up to nine replacements. string16 ReplaceStringPlaceholders(const string16& format_string, - const string16& a, - size_t* offset); - -string16 ReplaceStringPlaceholders(const string16& format_string, - const string16& a, - const string16& b, + const std::vector<string16>& subst, std::vector<size_t>* offsets); +// Single-string shortcut for ReplaceStringHolders. string16 ReplaceStringPlaceholders(const string16& format_string, const string16& a, - const string16& b, - const string16& c, - std::vector<size_t>* offsets); - -string16 ReplaceStringPlaceholders(const string16& format_string, - const string16& a, - const string16& b, - const string16& c, - const string16& d, - std::vector<size_t>* offsets); + size_t* offset); // 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 |