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

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

Issue 1399253004: Make base::IsUnicodeWhitespace('\0') return false. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add non-ASCII codepoint tests Created 5 years, 2 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 | « no previous file | base/strings/string_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 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 // This file defines utility functions for working with strings. 5 // This file defines utility functions for working with strings.
6 6
7 #ifndef BASE_STRINGS_STRING_UTIL_H_ 7 #ifndef BASE_STRINGS_STRING_UTIL_H_
8 #define BASE_STRINGS_STRING_UTIL_H_ 8 #define BASE_STRINGS_STRING_UTIL_H_
9 9
10 #include <ctype.h> 10 #include <ctype.h>
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 } 351 }
352 352
353 // Returns the integer corresponding to the given hex character. For example: 353 // Returns the integer corresponding to the given hex character. For example:
354 // '4' -> 4 354 // '4' -> 4
355 // 'a' -> 10 355 // 'a' -> 10
356 // 'B' -> 11 356 // 'B' -> 11
357 // Assumes the input is a valid hex character. DCHECKs in debug builds if not. 357 // Assumes the input is a valid hex character. DCHECKs in debug builds if not.
358 BASE_EXPORT char HexDigitToInt(wchar_t c); 358 BASE_EXPORT char HexDigitToInt(wchar_t c);
359 359
360 // Returns true if it's a Unicode whitespace character. 360 // Returns true if it's a Unicode whitespace character.
361 inline bool IsUnicodeWhitespace(wchar_t c) { 361 BASE_EXPORT bool IsUnicodeWhitespace(wchar_t c);
362 return wcschr(base::kWhitespaceWide, c) != NULL;
363 }
364 362
365 // Return a byte string in human-readable format with a unit suffix. Not 363 // Return a byte string in human-readable format with a unit suffix. Not
366 // appropriate for use in any UI; use of FormatBytes and friends in ui/base is 364 // appropriate for use in any UI; use of FormatBytes and friends in ui/base is
367 // highly recommended instead. TODO(avi): Figure out how to get callers to use 365 // highly recommended instead. TODO(avi): Figure out how to get callers to use
368 // FormatBytes instead; remove this. 366 // FormatBytes instead; remove this.
369 BASE_EXPORT string16 FormatBytesUnlocalized(int64 bytes); 367 BASE_EXPORT string16 FormatBytesUnlocalized(int64 bytes);
370 368
371 // Starting at |start_offset| (usually 0), replace the first instance of 369 // Starting at |start_offset| (usually 0), replace the first instance of
372 // |find_this| with |replace_with|. 370 // |find_this| with |replace_with|.
373 BASE_EXPORT void ReplaceFirstSubstringAfterOffset( 371 BASE_EXPORT void ReplaceFirstSubstringAfterOffset(
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 451
454 #if defined(OS_WIN) 452 #if defined(OS_WIN)
455 #include "base/strings/string_util_win.h" 453 #include "base/strings/string_util_win.h"
456 #elif defined(OS_POSIX) 454 #elif defined(OS_POSIX)
457 #include "base/strings/string_util_posix.h" 455 #include "base/strings/string_util_posix.h"
458 #else 456 #else
459 #error Define string operations appropriately for your platform 457 #error Define string operations appropriately for your platform
460 #endif 458 #endif
461 459
462 #endif // BASE_STRINGS_STRING_UTIL_H_ 460 #endif // BASE_STRINGS_STRING_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/strings/string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698