OLD | NEW |
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 BASE_EXPORT bool LowerCaseEqualsASCII(const char16* a_begin, | 310 BASE_EXPORT bool LowerCaseEqualsASCII(const char16* a_begin, |
311 const char16* a_end, | 311 const char16* a_end, |
312 const char* b); | 312 const char* b); |
313 | 313 |
314 // Performs a case-sensitive string compare. The behavior is undefined if both | 314 // Performs a case-sensitive string compare. The behavior is undefined if both |
315 // strings are not ASCII. | 315 // strings are not ASCII. |
316 BASE_EXPORT bool EqualsASCII(const string16& a, const StringPiece& b); | 316 BASE_EXPORT bool EqualsASCII(const string16& a, const StringPiece& b); |
317 | 317 |
318 } // namespace base | 318 } // namespace base |
319 | 319 |
320 #if defined(OS_WIN) | 320 #if defined(OS_POSIX) |
321 #include "base/strings/string_util_win.h" | |
322 #elif defined(OS_POSIX) | |
323 #include "base/strings/string_util_posix.h" | 321 #include "base/strings/string_util_posix.h" |
324 #else | 322 #else |
325 #error Define string operations appropriately for your platform | 323 #error Define string operations appropriately for your platform |
326 #endif | 324 #endif |
327 | 325 |
328 // Returns true if str starts with search, or false otherwise. | 326 // Returns true if str starts with search, or false otherwise. |
329 BASE_EXPORT bool StartsWithASCII(const std::string& str, | 327 BASE_EXPORT bool StartsWithASCII(const std::string& str, |
330 const std::string& search, | 328 const std::string& search, |
331 bool case_sensitive); | 329 bool case_sensitive); |
332 BASE_EXPORT bool StartsWith(const base::string16& str, | 330 BASE_EXPORT bool StartsWith(const base::string16& str, |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 // string can contain wildcards like * and ? | 496 // string can contain wildcards like * and ? |
499 // The backslash character (\) is an escape character for * and ? | 497 // The backslash character (\) is an escape character for * and ? |
500 // We limit the patterns to having a max of 16 * or ? characters. | 498 // We limit the patterns to having a max of 16 * or ? characters. |
501 // ? matches 0 or 1 character, while * matches 0 or more characters. | 499 // ? matches 0 or 1 character, while * matches 0 or more characters. |
502 BASE_EXPORT bool MatchPattern(const base::StringPiece& string, | 500 BASE_EXPORT bool MatchPattern(const base::StringPiece& string, |
503 const base::StringPiece& pattern); | 501 const base::StringPiece& pattern); |
504 BASE_EXPORT bool MatchPattern(const base::string16& string, | 502 BASE_EXPORT bool MatchPattern(const base::string16& string, |
505 const base::string16& pattern); | 503 const base::string16& pattern); |
506 | 504 |
507 #endif // BASE_STRINGS_STRING_UTIL_H_ | 505 #endif // BASE_STRINGS_STRING_UTIL_H_ |
OLD | NEW |