| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 bool equalIgnoringCase(const char* str) const | 94 bool equalIgnoringCase(const char* str) const |
| 95 { | 95 { |
| 96 if (is8Bit()) | 96 if (is8Bit()) |
| 97 return WTF::equalIgnoringCase(str, characters8(), length()); | 97 return WTF::equalIgnoringCase(str, characters8(), length()); |
| 98 return WTF::equalIgnoringCase(str, characters16(), length()); | 98 return WTF::equalIgnoringCase(str, characters16(), length()); |
| 99 } | 99 } |
| 100 | 100 |
| 101 template <size_t strLength> | 101 template <size_t strLength> |
| 102 bool startsWithIgnoringCase(const char (&str)[strLength]) const | 102 bool startsWithIgnoringCase(const char (&str)[strLength]) const |
| 103 { | 103 { |
| 104 return startsWithIgnoringCase(str, strLength - 1); | 104 return containsIgnoringCaseAt(str, strLength - 1, 0); |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool startsWithIgnoringCase(const char* str, size_t strLength) const | 107 template <size_t strLength> |
| 108 bool containsIgnoringCaseAt(const char (&str)[strLength], unsigned offset) c
onst |
| 108 { | 109 { |
| 109 if (length() < strLength) | 110 return containsIgnoringCaseAt(str, strLength - 1, offset); |
| 111 } |
| 112 |
| 113 bool containsIgnoringCaseAt(const char* str, size_t strLength, unsigned offs
et) const |
| 114 { |
| 115 if (length() < strLength + offset) |
| 110 return false; | 116 return false; |
| 111 return is8Bit() ? WTF::equalIgnoringCase(str, characters8(), strLength)
: WTF::equalIgnoringCase(str, characters16(), strLength); | 117 return is8Bit() ? WTF::equalIgnoringCase(str, characters8() + offset, st
rLength) : WTF::equalIgnoringCase(str, characters16() + offset, strLength); |
| 112 } | 118 } |
| 113 | 119 |
| 114 operator String() const { return is8Bit() ? String(m_data.characters8, m_len
gth) : String(m_data.characters16, m_length); } | 120 operator String() const { return is8Bit() ? String(m_data.characters8, m_len
gth) : String(m_data.characters16, m_length); } |
| 115 operator AtomicString() const { return is8Bit() ? AtomicString(m_data.charac
ters8, m_length) : AtomicString(m_data.characters16, m_length); } | 121 operator AtomicString() const { return is8Bit() ? AtomicString(m_data.charac
ters8, m_length) : AtomicString(m_data.characters16, m_length); } |
| 116 | 122 |
| 117 AtomicString atomicSubstring(unsigned position, unsigned length) const; | 123 AtomicString atomicSubstring(unsigned position, unsigned length) const; |
| 118 | 124 |
| 119 union { | 125 union { |
| 120 const LChar* characters8; | 126 const LChar* characters8; |
| 121 const UChar* characters16; | 127 const UChar* characters16; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 inline void CSSParserValue::setFromFunction(CSSParserFunction* function) | 256 inline void CSSParserValue::setFromFunction(CSSParserFunction* function) |
| 251 { | 257 { |
| 252 id = CSSValueInvalid; | 258 id = CSSValueInvalid; |
| 253 this->function = function; | 259 this->function = function; |
| 254 unit = Function; | 260 unit = Function; |
| 255 } | 261 } |
| 256 | 262 |
| 257 } | 263 } |
| 258 | 264 |
| 259 #endif | 265 #endif |
| OLD | NEW |