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

Side by Side Diff: base/string_util.h

Issue 347019: Convert ReplaceStringPlaceholders(std::string...) to take a (Closed)
Patch Set: a Created 11 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « app/l10n_util.cc ('k') | base/string_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file defines utility functions for working with strings. 5 // This file defines utility functions for working with strings.
6 6
7 #ifndef BASE_STRING_UTIL_H_ 7 #ifndef BASE_STRING_UTIL_H_
8 #define BASE_STRING_UTIL_H_ 8 #define BASE_STRING_UTIL_H_
9 9
10 #include <stdarg.h> // va_list 10 #include <stdarg.h> // va_list
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 void SplitStringAlongWhitespace(const std::string& str, 543 void SplitStringAlongWhitespace(const std::string& str,
544 std::vector<std::string>* result); 544 std::vector<std::string>* result);
545 545
546 // Replace $1-$2-$3..$9 in the format string with |a|-|b|-|c|..|i| respectively. 546 // Replace $1-$2-$3..$9 in the format string with |a|-|b|-|c|..|i| respectively.
547 // Additionally, $$ is replaced by $. The offsets parameter here can 547 // Additionally, $$ is replaced by $. The offsets parameter here can
548 // be NULL. This only allows you to use up to nine replacements. 548 // be NULL. This only allows you to use up to nine replacements.
549 string16 ReplaceStringPlaceholders(const string16& format_string, 549 string16 ReplaceStringPlaceholders(const string16& format_string,
550 const std::vector<string16>& subst, 550 const std::vector<string16>& subst,
551 std::vector<size_t>* offsets); 551 std::vector<size_t>* offsets);
552 552
553 std::string ReplaceStringPlaceholders(const std::string& format_string, 553 std::string ReplaceStringPlaceholders(const base::StringPiece& format_string,
554 const std::vector<std::string>& subst, 554 const std::vector<std::string>& subst,
555 std::vector<size_t>* offsets); 555 std::vector<size_t>* offsets);
556 556
557 // Single-string shortcut for ReplaceStringHolders. 557 // Single-string shortcut for ReplaceStringHolders.
558 string16 ReplaceStringPlaceholders(const string16& format_string, 558 string16 ReplaceStringPlaceholders(const string16& format_string,
559 const string16& a, 559 const string16& a,
560 size_t* offset); 560 size_t* offset);
561 561
562 // If the size of |input| is more than |max_len|, this function returns true and 562 // If the size of |input| is more than |max_len|, this function returns true and
563 // |input| is shortened into |output| by removing chars in the middle (they are 563 // |input| is shortened into |output| by removing chars in the middle (they are
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 #elif defined(WCHAR_T_IS_UTF32) 607 #elif defined(WCHAR_T_IS_UTF32)
608 typedef uint32 Unsigned; 608 typedef uint32 Unsigned;
609 #endif 609 #endif
610 }; 610 };
611 template<> 611 template<>
612 struct ToUnsigned<short> { 612 struct ToUnsigned<short> {
613 typedef unsigned short Unsigned; 613 typedef unsigned short Unsigned;
614 }; 614 };
615 615
616 #endif // BASE_STRING_UTIL_H_ 616 #endif // BASE_STRING_UTIL_H_
OLDNEW
« no previous file with comments | « app/l10n_util.cc ('k') | base/string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698