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

Side by Side Diff: base/string_util.cc

Issue 165297: Replaces some TrimWhitespace with TrimWhitespaceASCII or TrimWhitespaceUTF8.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: hunspell fix Created 11 years, 4 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 | « no previous file | chrome/browser/extensions/extension_file_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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 431
432 TrimPositions TrimWhitespace(const std::wstring& input, 432 TrimPositions TrimWhitespace(const std::wstring& input,
433 TrimPositions positions, 433 TrimPositions positions,
434 std::wstring* output) { 434 std::wstring* output) {
435 return TrimStringT(input, kWhitespaceWide, positions, output); 435 return TrimStringT(input, kWhitespaceWide, positions, output);
436 } 436 }
437 437
438 TrimPositions TrimWhitespaceASCII(const std::string& input, 438 TrimPositions TrimWhitespaceASCII(const std::string& input,
439 TrimPositions positions, 439 TrimPositions positions,
440 std::string* output) { 440 std::string* output) {
441 DCHECK(IsStringASCII(input));
441 return TrimStringT(input, kWhitespaceASCII, positions, output); 442 return TrimStringT(input, kWhitespaceASCII, positions, output);
442 } 443 }
443 444
444 // This function is only for backward-compatibility. 445 // This function is only for backward-compatibility.
445 // To be removed when all callers are updated. 446 // To be removed when all callers are updated.
446 TrimPositions TrimWhitespace(const std::string& input, 447 TrimPositions TrimWhitespace(const std::string& input,
447 TrimPositions positions, 448 TrimPositions positions,
448 std::string* output) { 449 std::string* output) {
449 return TrimWhitespaceASCII(input, positions, output); 450 return TrimWhitespaceASCII(input, positions, output);
450 } 451 }
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 // Each input byte creates two output hex characters. 1666 // Each input byte creates two output hex characters.
1666 std::string ret(size * 2, '\0'); 1667 std::string ret(size * 2, '\0');
1667 1668
1668 for (size_t i = 0; i < size; ++i) { 1669 for (size_t i = 0; i < size; ++i) {
1669 char b = reinterpret_cast<const char*>(bytes)[i]; 1670 char b = reinterpret_cast<const char*>(bytes)[i];
1670 ret[(i * 2)] = kHexChars[(b >> 4) & 0xf]; 1671 ret[(i * 2)] = kHexChars[(b >> 4) & 0xf];
1671 ret[(i * 2) + 1] = kHexChars[b & 0xf]; 1672 ret[(i * 2) + 1] = kHexChars[b & 0xf];
1672 } 1673 }
1673 return ret; 1674 return ret;
1674 } 1675 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698