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

Side by Side Diff: base/string_util.h

Issue 197018: Strip .plugin off of Mac plugin names when showing the crash info bar. (Closed)
Patch Set: Add a test with the match in the middle Created 11 years, 3 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/string_util.cc » ('j') | base/string_util_unittest.cc » ('J')
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 // This file defines utility functions for working with strings. 5 // This file defines utility functions for working with strings.
6 6
7 #ifndef BASE_STRING_UTIL_H_ 7 #ifndef BASE_STRING_UTIL_H_
8 #define BASE_STRING_UTIL_H_ 8 #define BASE_STRING_UTIL_H_
9 9
10 #include <stdarg.h> // va_list 10 #include <stdarg.h> // va_list
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 bool EqualsASCII(const string16& a, const StringPiece& b); 356 bool EqualsASCII(const string16& a, const StringPiece& b);
357 357
358 // Returns true if str starts with search, or false otherwise. 358 // Returns true if str starts with search, or false otherwise.
359 bool StartsWithASCII(const std::string& str, 359 bool StartsWithASCII(const std::string& str,
360 const std::string& search, 360 const std::string& search,
361 bool case_sensitive); 361 bool case_sensitive);
362 bool StartsWith(const std::wstring& str, 362 bool StartsWith(const std::wstring& str,
363 const std::wstring& search, 363 const std::wstring& search,
364 bool case_sensitive); 364 bool case_sensitive);
365 365
366 // Returns true if str ends with search, or false otherwise.
367 bool EndsWith(const std::wstring& str,
368 const std::wstring& search,
369 bool case_sensitive);
370
371
366 // Determines the type of ASCII character, independent of locale (the C 372 // Determines the type of ASCII character, independent of locale (the C
367 // library versions will change based on locale). 373 // library versions will change based on locale).
368 template <typename Char> 374 template <typename Char>
369 inline bool IsAsciiWhitespace(Char c) { 375 inline bool IsAsciiWhitespace(Char c) {
370 return c == ' ' || c == '\r' || c == '\n' || c == '\t'; 376 return c == ' ' || c == '\r' || c == '\n' || c == '\t';
371 } 377 }
372 template <typename Char> 378 template <typename Char>
373 inline bool IsAsciiAlpha(Char c) { 379 inline bool IsAsciiAlpha(Char c) {
374 return ((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')); 380 return ((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z'));
375 } 381 }
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 #elif defined(WCHAR_T_IS_UTF32) 660 #elif defined(WCHAR_T_IS_UTF32)
655 typedef uint32 Unsigned; 661 typedef uint32 Unsigned;
656 #endif 662 #endif
657 }; 663 };
658 template<> 664 template<>
659 struct ToUnsigned<short> { 665 struct ToUnsigned<short> {
660 typedef unsigned short Unsigned; 666 typedef unsigned short Unsigned;
661 }; 667 };
662 668
663 #endif // BASE_STRING_UTIL_H_ 669 #endif // BASE_STRING_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/string_util.cc » ('j') | base/string_util_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698