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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 template<typename CharacterType> | 258 template<typename CharacterType> |
259 bool contains(CharacterType c) const { return find(c) != kNotFound; } | 259 bool contains(CharacterType c) const { return find(c) != kNotFound; } |
260 bool contains(const LChar* str, TextCaseSensitivity caseSensitivity = TextCa
seSensitive) const { return find(str, 0, caseSensitivity) != kNotFound; } | 260 bool contains(const LChar* str, TextCaseSensitivity caseSensitivity = TextCa
seSensitive) const { return find(str, 0, caseSensitivity) != kNotFound; } |
261 bool contains(const String& str, TextCaseSensitivity caseSensitivity = TextC
aseSensitive) const { return find(str, 0, caseSensitivity) != kNotFound; } | 261 bool contains(const String& str, TextCaseSensitivity caseSensitivity = TextC
aseSensitive) const { return find(str, 0, caseSensitivity) != kNotFound; } |
262 | 262 |
263 bool startsWith(const String& s, TextCaseSensitivity caseSensitivity = TextC
aseSensitive) const | 263 bool startsWith(const String& s, TextCaseSensitivity caseSensitivity = TextC
aseSensitive) const |
264 { return m_impl ? m_impl->startsWith(s.impl(), caseSensitivity) : s.isEm
pty(); } | 264 { return m_impl ? m_impl->startsWith(s.impl(), caseSensitivity) : s.isEm
pty(); } |
265 bool startsWith(UChar character) const | 265 bool startsWith(UChar character) const |
266 { return m_impl ? m_impl->startsWith(character) : false; } | 266 { return m_impl ? m_impl->startsWith(character) : false; } |
267 template<unsigned matchLength> | 267 template<unsigned matchLength> |
268 bool startsWith(const char (&prefix)[matchLength], TextCaseSensitivity caseS
ensitivity = TextCaseSensitive) const | 268 bool startsWith(const char (&prefix)[matchLength]) const |
269 { return m_impl ? m_impl->startsWith<matchLength>(prefix, caseSensitivit
y) : !matchLength; } | 269 { return m_impl ? m_impl->startsWith(prefix, matchLength - 1) : !matchLe
ngth; } |
270 | 270 |
271 bool endsWith(const String& s, TextCaseSensitivity caseSensitivity = TextCas
eSensitive) const | 271 bool endsWith(const String& s, TextCaseSensitivity caseSensitivity = TextCas
eSensitive) const |
272 { return m_impl ? m_impl->endsWith(s.impl(), caseSensitivity) : s.isEmpt
y(); } | 272 { return m_impl ? m_impl->endsWith(s.impl(), caseSensitivity) : s.isEmpt
y(); } |
273 bool endsWith(UChar character) const | 273 bool endsWith(UChar character) const |
274 { return m_impl ? m_impl->endsWith(character) : false; } | 274 { return m_impl ? m_impl->endsWith(character) : false; } |
275 template<unsigned matchLength> | 275 template<unsigned matchLength> |
276 bool endsWith(const char (&prefix)[matchLength], TextCaseSensitivity caseSen
sitivity = TextCaseSensitive) const | 276 bool endsWith(const char (&prefix)[matchLength]) const |
277 { return m_impl ? m_impl->endsWith<matchLength>(prefix, caseSensitivity)
: !matchLength; } | 277 { return m_impl ? m_impl->endsWith(prefix, matchLength - 1) : !matchLeng
th; } |
278 | 278 |
279 void append(const String&); | 279 void append(const String&); |
280 void append(LChar); | 280 void append(LChar); |
281 void append(char c) { append(static_cast<LChar>(c)); } | 281 void append(char c) { append(static_cast<LChar>(c)); } |
282 void append(UChar); | 282 void append(UChar); |
283 void append(const LChar*, unsigned length); | 283 void append(const LChar*, unsigned length); |
284 void append(const char* charactersToAppend, unsigned length) { append(reinte
rpret_cast<const LChar*>(charactersToAppend), length); } | 284 void append(const char* charactersToAppend, unsigned length) { append(reinte
rpret_cast<const LChar*>(charactersToAppend), length); } |
285 void append(const UChar*, unsigned length); | 285 void append(const UChar*, unsigned length); |
286 void insert(const String&, unsigned pos); | 286 void insert(const String&, unsigned pos); |
287 void insert(const LChar*, unsigned length, unsigned pos); | 287 void insert(const LChar*, unsigned length, unsigned pos); |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 using WTF::charactersToFloat; | 693 using WTF::charactersToFloat; |
694 using WTF::equal; | 694 using WTF::equal; |
695 using WTF::equalIgnoringCase; | 695 using WTF::equalIgnoringCase; |
696 using WTF::find; | 696 using WTF::find; |
697 using WTF::isAllSpecialCharacters; | 697 using WTF::isAllSpecialCharacters; |
698 using WTF::isSpaceOrNewline; | 698 using WTF::isSpaceOrNewline; |
699 using WTF::reverseFind; | 699 using WTF::reverseFind; |
700 | 700 |
701 #include "wtf/text/AtomicString.h" | 701 #include "wtf/text/AtomicString.h" |
702 #endif // WTFString_h | 702 #endif // WTFString_h |
OLD | NEW |