| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 size_t find(LChar c, unsigned start = 0) const | 175 size_t find(LChar c, unsigned start = 0) const |
| 176 { return m_impl ? m_impl->find(c, start) : kNotFound; } | 176 { return m_impl ? m_impl->find(c, start) : kNotFound; } |
| 177 size_t find(char c, unsigned start = 0) const { return find(static_cast<LCha
r>(c), start); } | 177 size_t find(char c, unsigned start = 0) const { return find(static_cast<LCha
r>(c), start); } |
| 178 size_t find(CharacterMatchFunctionPtr matchFunction, unsigned start = 0) con
st | 178 size_t find(CharacterMatchFunctionPtr matchFunction, unsigned start = 0) con
st |
| 179 { return m_impl ? m_impl->find(matchFunction, start) : kNotFound; } | 179 { return m_impl ? m_impl->find(matchFunction, start) : kNotFound; } |
| 180 | 180 |
| 181 // Find substrings. | 181 // Find substrings. |
| 182 size_t find(const StringView& value, unsigned start = 0, TextCaseSensitivity
caseSensitivity = TextCaseSensitive) const | 182 size_t find(const StringView& value, unsigned start = 0, TextCaseSensitivity
caseSensitivity = TextCaseSensitive) const |
| 183 { return m_impl ? DISPATCH_CASE_OP(caseSensitivity, m_impl->find, (value
, start)) : kNotFound; } | 183 { return m_impl ? DISPATCH_CASE_OP(caseSensitivity, m_impl->find, (value
, start)) : kNotFound; } |
| 184 | 184 |
| 185 bool contains(char c) const { return find(c) != kNotFound; } |
| 186 bool contains(const StringView& value, TextCaseSensitivity caseSensitivity =
TextCaseSensitive) const |
| 187 { return find(value, 0, caseSensitivity) != kNotFound; } |
| 188 |
| 185 // Find the last instance of a single character or string. | 189 // Find the last instance of a single character or string. |
| 186 size_t reverseFind(UChar c, unsigned start = UINT_MAX) const | 190 size_t reverseFind(UChar c, unsigned start = UINT_MAX) const |
| 187 { return m_impl ? m_impl->reverseFind(c, start) : kNotFound; } | 191 { return m_impl ? m_impl->reverseFind(c, start) : kNotFound; } |
| 188 size_t reverseFind(const String& str, unsigned start = UINT_MAX) const | 192 size_t reverseFind(const String& str, unsigned start = UINT_MAX) const |
| 189 { return m_impl ? m_impl->reverseFind(str.impl(), start) : kNotFound; } | 193 { return m_impl ? m_impl->reverseFind(str.impl(), start) : kNotFound; } |
| 190 | 194 |
| 191 // Case insensitive string matching. | 195 // Case insensitive string matching. |
| 192 size_t findIgnoringCase(const LChar* str, unsigned start = 0) const | 196 size_t findIgnoringCase(const LChar* str, unsigned start = 0) const |
| 193 { return m_impl ? m_impl->findIgnoringCase(str, start) : kNotFound; } | 197 { return m_impl ? m_impl->findIgnoringCase(str, start) : kNotFound; } |
| 194 size_t findIgnoringCase(const String& str, unsigned start = 0) const | 198 size_t findIgnoringCase(const String& str, unsigned start = 0) const |
| 195 { return m_impl ? m_impl->findIgnoringCase(str.impl(), start) : kNotFoun
d; } | 199 { return m_impl ? m_impl->findIgnoringCase(str.impl(), start) : kNotFoun
d; } |
| 196 | 200 |
| 197 // ASCII case insensitive string matching. | 201 // ASCII case insensitive string matching. |
| 198 size_t findIgnoringASCIICase(const String& str, unsigned start = 0) const | 202 size_t findIgnoringASCIICase(const String& str, unsigned start = 0) const |
| 199 { return m_impl ? m_impl->findIgnoringASCIICase(str.impl(), start) : kNo
tFound; } | 203 { return m_impl ? m_impl->findIgnoringASCIICase(str.impl(), start) : kNo
tFound; } |
| 200 | 204 |
| 201 unsigned copyTo(UChar* buffer, unsigned pos, unsigned maxLength) const; | 205 unsigned copyTo(UChar* buffer, unsigned pos, unsigned maxLength) const; |
| 202 | 206 |
| 203 template<typename BufferType> | 207 template<typename BufferType> |
| 204 void appendTo(BufferType&, unsigned pos = 0, unsigned len = UINT_MAX) const; | 208 void appendTo(BufferType&, unsigned pos = 0, unsigned len = UINT_MAX) const; |
| 205 | 209 |
| 206 template<typename BufferType> | 210 template<typename BufferType> |
| 207 void prependTo(BufferType&, unsigned pos = 0, unsigned len = UINT_MAX) const
; | 211 void prependTo(BufferType&, unsigned pos = 0, unsigned len = UINT_MAX) const
; |
| 208 | 212 |
| 209 UChar32 characterStartingAt(unsigned) const; | 213 UChar32 characterStartingAt(unsigned) const; |
| 210 template<typename CharacterType> | |
| 211 bool contains(CharacterType c) const { return find(c) != kNotFound; } | |
| 212 bool contains(const LChar* str, TextCaseSensitivity caseSensitivity = TextCa
seSensitive) const { return find(str, 0, caseSensitivity) != kNotFound; } | |
| 213 bool contains(const String& str, TextCaseSensitivity caseSensitivity = TextC
aseSensitive) const { return find(str, 0, caseSensitivity) != kNotFound; } | |
| 214 | 214 |
| 215 bool startsWith(const StringView& prefix, TextCaseSensitivity caseSensitivit
y = TextCaseSensitive) const | 215 bool startsWith(const StringView& prefix, TextCaseSensitivity caseSensitivit
y = TextCaseSensitive) const |
| 216 { return m_impl ? DISPATCH_CASE_OP(caseSensitivity, m_impl->startsWith,
(prefix)) : prefix.isEmpty(); } | 216 { return m_impl ? DISPATCH_CASE_OP(caseSensitivity, m_impl->startsWith,
(prefix)) : prefix.isEmpty(); } |
| 217 bool startsWith(UChar character) const | 217 bool startsWith(UChar character) const |
| 218 { return m_impl ? m_impl->startsWith(character) : false; } | 218 { return m_impl ? m_impl->startsWith(character) : false; } |
| 219 | 219 |
| 220 bool endsWith(const StringView& suffix, TextCaseSensitivity caseSensitivity
= TextCaseSensitive) const | 220 bool endsWith(const StringView& suffix, TextCaseSensitivity caseSensitivity
= TextCaseSensitive) const |
| 221 { return m_impl ? DISPATCH_CASE_OP(caseSensitivity, m_impl->endsWith, (s
uffix)) : suffix.isEmpty(); } | 221 { return m_impl ? DISPATCH_CASE_OP(caseSensitivity, m_impl->endsWith, (s
uffix)) : suffix.isEmpty(); } |
| 222 bool endsWith(UChar character) const | 222 bool endsWith(UChar character) const |
| 223 { return m_impl ? m_impl->endsWith(character) : false; } | 223 { return m_impl ? m_impl->endsWith(character) : false; } |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 using WTF::append; | 600 using WTF::append; |
| 601 using WTF::charactersAreAllASCII; | 601 using WTF::charactersAreAllASCII; |
| 602 using WTF::equal; | 602 using WTF::equal; |
| 603 using WTF::find; | 603 using WTF::find; |
| 604 using WTF::isAllSpecialCharacters; | 604 using WTF::isAllSpecialCharacters; |
| 605 using WTF::isSpaceOrNewline; | 605 using WTF::isSpaceOrNewline; |
| 606 using WTF::reverseFind; | 606 using WTF::reverseFind; |
| 607 | 607 |
| 608 #include "wtf/text/AtomicString.h" | 608 #include "wtf/text/AtomicString.h" |
| 609 #endif // WTFString_h | 609 #endif // WTFString_h |
| OLD | NEW |