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

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: Final rebase Created 5 years, 10 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
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. 457 // TODO(jdduke): Remove guards after complete adoption of libc++ on Android.
458 #if !defined(OS_ANDROID) 458 #if !defined(OS_ANDROID) || !defined(USE_STLPORT)
459 bool LowerCaseEqualsASCII(const char* a_begin, 459 bool LowerCaseEqualsASCII(const char* a_begin,
460 const char* a_end, 460 const char* a_end,
461 const char* b) { 461 const char* b) {
462 return DoLowerCaseEqualsASCII(a_begin, a_end, b); 462 return DoLowerCaseEqualsASCII(a_begin, a_end, b);
463 } 463 }
464 464
465 bool LowerCaseEqualsASCII(const char16* a_begin, 465 bool LowerCaseEqualsASCII(const char16* a_begin,
466 const char16* a_end, 466 const char16* a_end,
467 const char* b) { 467 const char* b) {
468 return DoLowerCaseEqualsASCII(a_begin, a_end, b); 468 return DoLowerCaseEqualsASCII(a_begin, a_end, b);
469 } 469 }
470 470 #endif // !defined(OS_ANDROID) || !defined(USE_STLPORT)
471 #endif // !defined(OS_ANDROID)
472 471
473 bool EqualsASCII(const string16& a, const base::StringPiece& b) { 472 bool EqualsASCII(const string16& a, const base::StringPiece& b) {
474 if (a.length() != b.length()) 473 if (a.length() != b.length())
475 return false; 474 return false;
476 return std::equal(b.begin(), b.end(), a.begin()); 475 return std::equal(b.begin(), b.end(), a.begin());
477 } 476 }
478 477
479 bool StartsWithASCII(const std::string& str, 478 bool StartsWithASCII(const std::string& str,
480 const std::string& search, 479 const std::string& search,
481 bool case_sensitive) { 480 bool case_sensitive) {
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 } 1028 }
1030 1029
1031 } // namespace 1030 } // namespace
1032 1031
1033 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) { 1032 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) {
1034 return lcpyT<char>(dst, src, dst_size); 1033 return lcpyT<char>(dst, src, dst_size);
1035 } 1034 }
1036 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) { 1035 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) {
1037 return lcpyT<wchar_t>(dst, src, dst_size); 1036 return lcpyT<wchar_t>(dst, src, dst_size);
1038 } 1037 }
OLDNEW
« no previous file with comments | « base/containers/hash_tables.h ('k') | build/android/setup.gyp » ('j') | build/common.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698