Chromium Code Reviews| Index: base/strings/string_util.h |
| diff --git a/base/strings/string_util.h b/base/strings/string_util.h |
| index e20bbf0a40c59f9440a23812ca7e8723dd2c9dec..21e0d72acb8e7fe6ee88687b4251025e7d0e67f0 100644 |
| --- a/base/strings/string_util.h |
| +++ b/base/strings/string_util.h |
| @@ -245,9 +245,14 @@ BASE_EXPORT bool ContainsOnlyChars(const StringPiece16& input, |
| // to have the maximum 'discriminating' power from other encodings. If |
| // there's a use case for just checking the structural validity, we have to |
| // add a new function for that. |
| +// |
| +// IsStringASCII assumes the input is likely all ASCII, and does not leave early |
| +// if it is not the case. |
| BASE_EXPORT bool IsStringUTF8(const std::string& str); |
| BASE_EXPORT bool IsStringASCII(const StringPiece& str); |
| BASE_EXPORT bool IsStringASCII(const string16& str); |
| +BASE_EXPORT bool IsStringASCII(const char* src, size_t src_len); |
|
brettw
2014/09/16 17:14:28
The string piece version should cover this case. A
mnaganov (inactive)
2014/09/17 15:15:01
You are right, I didn't think about this, thanks!
|
| +BASE_EXPORT bool IsStringASCII(const char16* src, size_t src_len); |
| // Converts the elements of the given string. This version uses a pointer to |
| // clearly differentiate it from the non-pointer variant. |