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

Side by Side Diff: base/string_util.cc

Issue 4371001: Fix clang build by moving ToLowerASCII into base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « base/string_util.h ('k') | chrome/browser/chromeos/input_method/input_method_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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/string_util.h" 5 #include "base/string_util.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <ctype.h> 9 #include <ctype.h>
10 #include <errno.h> 10 #include <errno.h>
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 return false; 477 return false;
478 } 478 }
479 return true; 479 return true;
480 } 480 }
481 481
482 template<typename Iter> 482 template<typename Iter>
483 static inline bool DoLowerCaseEqualsASCII(Iter a_begin, 483 static inline bool DoLowerCaseEqualsASCII(Iter a_begin,
484 Iter a_end, 484 Iter a_end,
485 const char* b) { 485 const char* b) {
486 for (Iter it = a_begin; it != a_end; ++it, ++b) { 486 for (Iter it = a_begin; it != a_end; ++it, ++b) {
487 if (!*b || ToLowerASCII(*it) != *b) 487 if (!*b || base::ToLowerASCII(*it) != *b)
488 return false; 488 return false;
489 } 489 }
490 return *b == 0; 490 return *b == 0;
491 } 491 }
492 492
493 // Front-ends for LowerCaseEqualsASCII. 493 // Front-ends for LowerCaseEqualsASCII.
494 bool LowerCaseEqualsASCII(const std::string& a, const char* b) { 494 bool LowerCaseEqualsASCII(const std::string& a, const char* b) {
495 return DoLowerCaseEqualsASCII(a.begin(), a.end(), b); 495 return DoLowerCaseEqualsASCII(a.begin(), a.end(), b);
496 } 496 }
497 497
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 int rstr_len = (max_len - 3) / 2; 1177 int rstr_len = (max_len - 3) / 2;
1178 int lstr_len = rstr_len + ((max_len - 3) % 2); 1178 int lstr_len = rstr_len + ((max_len - 3) % 2);
1179 output->assign(input.substr(0, lstr_len) + L"..." + 1179 output->assign(input.substr(0, lstr_len) + L"..." +
1180 input.substr(input.length() - rstr_len)); 1180 input.substr(input.length() - rstr_len));
1181 break; 1181 break;
1182 } 1182 }
1183 } 1183 }
1184 1184
1185 return true; 1185 return true;
1186 } 1186 }
OLDNEW
« no previous file with comments | « base/string_util.h ('k') | chrome/browser/chromeos/input_method/input_method_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698