Changeset 67423 in webkit for trunk/JavaScriptCore
- Timestamp:
- Sep 13, 2010, 4:42:02 PM (15 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r67401 r67423 1 2010-09-13 Darin Adler <[email protected]> 2 3 Reviewed by Adam Barth. 4 5 Preparation for eliminating deprecatedParseURL 6 https://bugs.webkit.org/show_bug.cgi?id=45695 7 8 * wtf/text/WTFString.h: Added isAllSpecialCharacters, moved here from 9 the HTML tree builder. 10 1 11 2010-09-13 Darin Fisher <[email protected]> 2 12 -
trunk/JavaScriptCore/wtf/text/WTFString.h
r66159 r67423 54 54 55 55 class CString; 56 struct StringHash; 56 57 57 58 // Declarations of string operations … … 72 73 double charactersToDouble(const UChar*, size_t, bool* ok = 0); 73 74 float charactersToFloat(const UChar*, size_t, bool* ok = 0); 75 76 template<bool isSpecialCharacter(UChar)> bool isAllSpecialCharacters(const UChar*, size_t); 74 77 75 78 class String { … … 221 224 222 225 String removeCharacters(CharacterMatchFunctionPtr) const; 226 template<bool isSpecialCharacter(UChar)> bool isAllSpecialCharacters() const; 223 227 224 228 // Return the string with case folded for case insensitive comparison. … … 424 428 } 425 429 426 struct StringHash; 430 template<bool isSpecialCharacter(UChar)> inline bool isAllSpecialCharacters(const UChar* characters, size_t length) 431 { 432 for (size_t i = 0; i < length; ++i) { 433 if (!isSpecialCharacter(characters[i])) 434 return false; 435 } 436 return true; 437 } 438 439 template<bool isSpecialCharacter(UChar)> inline bool String::isAllSpecialCharacters() const 440 { 441 return WTF::isAllSpecialCharacters<isSpecialCharacter>(characters(), length()); 442 } 427 443 428 444 // StringHash is the default hash for String … … 441 457 using WTF::CString; 442 458 using WTF::String; 443 444 using WTF::isSpaceOrNewline;445 using WTF::find;446 using WTF::reverseFind;447 459 using WTF::append; 448 460 using WTF::appendNumber; 461 using WTF::charactersAreAllASCII; 462 using WTF::charactersToDouble; 463 using WTF::charactersToFloat; 464 using WTF::charactersToInt; 449 465 using WTF::equal; 450 466 using WTF::equalIgnoringCase; 451 using WTF:: charactersAreAllASCII;452 using WTF:: charactersToInt;453 using WTF:: charactersToFloat;454 using WTF:: charactersToDouble;455 456 #endif 467 using WTF::find; 468 using WTF::isAllSpecialCharacters; 469 using WTF::isSpaceOrNewline; 470 using WTF::reverseFind; 471 472 #endif
Note:
See TracChangeset
for help on using the changeset viewer.