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

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

Issue 951983002: Reland "Enable libc++ on Android" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clang+mesa Created 5 years, 7 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
« no previous file with comments | « base/containers/hash_tables.h ('k') | build/android/setup.gyp » ('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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 const char* b) { 447 const char* b) {
448 return DoLowerCaseEqualsASCII(a_begin, a_end, b); 448 return DoLowerCaseEqualsASCII(a_begin, a_end, b);
449 } 449 }
450 450
451 bool LowerCaseEqualsASCII(string16::const_iterator a_begin, 451 bool LowerCaseEqualsASCII(string16::const_iterator a_begin,
452 string16::const_iterator a_end, 452 string16::const_iterator a_end,
453 const char* b) { 453 const char* b) {
454 return DoLowerCaseEqualsASCII(a_begin, a_end, b); 454 return DoLowerCaseEqualsASCII(a_begin, a_end, b);
455 } 455 }
456 456
457 // TODO(port): Resolve wchar_t/iterator issues that require OS_ANDROID here.
458 #if !defined(OS_ANDROID)
459 bool LowerCaseEqualsASCII(const char* a_begin, 457 bool LowerCaseEqualsASCII(const char* a_begin,
460 const char* a_end, 458 const char* a_end,
461 const char* b) { 459 const char* b) {
462 return DoLowerCaseEqualsASCII(a_begin, a_end, b); 460 return DoLowerCaseEqualsASCII(a_begin, a_end, b);
463 } 461 }
464 462
465 bool LowerCaseEqualsASCII(const char16* a_begin, 463 bool LowerCaseEqualsASCII(const char16* a_begin,
466 const char16* a_end, 464 const char16* a_end,
467 const char* b) { 465 const char* b) {
468 return DoLowerCaseEqualsASCII(a_begin, a_end, b); 466 return DoLowerCaseEqualsASCII(a_begin, a_end, b);
469 } 467 }
470 468
471 #endif // !defined(OS_ANDROID)
472
473 bool EqualsASCII(const string16& a, const base::StringPiece& b) { 469 bool EqualsASCII(const string16& a, const base::StringPiece& b) {
474 if (a.length() != b.length()) 470 if (a.length() != b.length())
475 return false; 471 return false;
476 return std::equal(b.begin(), b.end(), a.begin()); 472 return std::equal(b.begin(), b.end(), a.begin());
477 } 473 }
478 474
479 bool StartsWithASCII(const std::string& str, 475 bool StartsWithASCII(const std::string& str,
480 const std::string& search, 476 const std::string& search,
481 bool case_sensitive) { 477 bool case_sensitive) {
482 if (case_sensitive) 478 if (case_sensitive)
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 } 1025 }
1030 1026
1031 } // namespace 1027 } // namespace
1032 1028
1033 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) { 1029 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) {
1034 return lcpyT<char>(dst, src, dst_size); 1030 return lcpyT<char>(dst, src, dst_size);
1035 } 1031 }
1036 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) { 1032 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) {
1037 return lcpyT<wchar_t>(dst, src, dst_size); 1033 return lcpyT<wchar_t>(dst, src, dst_size);
1038 } 1034 }
OLDNEW
« no previous file with comments | « base/containers/hash_tables.h ('k') | build/android/setup.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698