OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |