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

Side by Side Diff: base/strings/string_util.cc

Issue 102993018: Remove UTF string conversion functions from the global namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: aaaaaaaaaa Created 6 years, 12 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/logging.cc ('k') | base/strings/utf_string_conversions.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "base/strings/string_util.h" 5 #include "base/strings/string_util.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <math.h> 9 #include <math.h>
10 #include <stdarg.h> 10 #include <stdarg.h>
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 char buf[64]; 526 char buf[64];
527 if (bytes != 0 && dimension > 0 && unit_amount < 100) { 527 if (bytes != 0 && dimension > 0 && unit_amount < 100) {
528 base::snprintf(buf, arraysize(buf), "%.1lf%s", unit_amount, 528 base::snprintf(buf, arraysize(buf), "%.1lf%s", unit_amount,
529 kByteStringsUnlocalized[dimension]); 529 kByteStringsUnlocalized[dimension]);
530 } else { 530 } else {
531 base::snprintf(buf, arraysize(buf), "%.0lf%s", unit_amount, 531 base::snprintf(buf, arraysize(buf), "%.0lf%s", unit_amount,
532 kByteStringsUnlocalized[dimension]); 532 kByteStringsUnlocalized[dimension]);
533 } 533 }
534 534
535 return ASCIIToUTF16(buf); 535 return base::ASCIIToUTF16(buf);
536 } 536 }
537 537
538 template<class StringType> 538 template<class StringType>
539 void DoReplaceSubstringsAfterOffset(StringType* str, 539 void DoReplaceSubstringsAfterOffset(StringType* str,
540 typename StringType::size_type start_offset, 540 typename StringType::size_type start_offset,
541 const StringType& find_this, 541 const StringType& find_this,
542 const StringType& replace_with, 542 const StringType& replace_with,
543 bool replace_all) { 543 bool replace_all) {
544 if ((start_offset == StringType::npos) || (start_offset >= str->length())) 544 if ((start_offset == StringType::npos) || (start_offset >= str->length()))
545 return; 545 return;
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 } 928 }
929 929
930 } // namespace 930 } // namespace
931 931
932 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) { 932 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) {
933 return lcpyT<char>(dst, src, dst_size); 933 return lcpyT<char>(dst, src, dst_size);
934 } 934 }
935 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) { 935 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) {
936 return lcpyT<wchar_t>(dst, src, dst_size); 936 return lcpyT<wchar_t>(dst, src, dst_size);
937 } 937 }
OLDNEW
« no previous file with comments | « base/logging.cc ('k') | base/strings/utf_string_conversions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698