Chromium Code Reviews| 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 423 template<size_t inlineCapacity> | 423 template<size_t inlineCapacity> |
| 424 static String make8BitFrom16BitSource(const Vector<UChar, inlineCapacity>& b uffer) | 424 static String make8BitFrom16BitSource(const Vector<UChar, inlineCapacity>& b uffer) |
| 425 { | 425 { |
| 426 return make8BitFrom16BitSource(buffer.data(), buffer.size()); | 426 return make8BitFrom16BitSource(buffer.data(), buffer.size()); |
| 427 } | 427 } |
| 428 | 428 |
| 429 static String make16BitFrom8BitSource(const LChar*, size_t); | 429 static String make16BitFrom8BitSource(const LChar*, size_t); |
| 430 | 430 |
| 431 // String::fromUTF8 will return a null string if | 431 // String::fromUTF8 will return a null string if |
| 432 // the input data contains invalid UTF-8 sequences. | 432 // the input data contains invalid UTF-8 sequences. |
| 433 static String fromUTF8(const LChar*, size_t); | 433 static String fromUTF8(const LChar*, size_t, bool strict = true); |
|
jsbell
2016/03/08 20:28:15
Please update the documentation.
horo
2016/03/09 01:58:40
Done.
| |
| 434 static String fromUTF8(const LChar*); | 434 static String fromUTF8(const LChar*); |
| 435 static String fromUTF8(const char* s, size_t length) { return fromUTF8(reint erpret_cast<const LChar*>(s), length); } | 435 static String fromUTF8(const char* s, size_t length) { return fromUTF8(reint erpret_cast<const LChar*>(s), length); } |
| 436 static String fromUTF8(const char* s) { return fromUTF8(reinterpret_cast<con st LChar*>(s)); } | 436 static String fromUTF8(const char* s) { return fromUTF8(reinterpret_cast<con st LChar*>(s)); } |
| 437 static String fromUTF8(const CString&); | 437 static String fromUTF8(const CString&); |
| 438 | 438 |
| 439 // Tries to convert the passed in string to UTF-8, but will fall back to | 439 // Tries to convert the passed in string to UTF-8, but will fall back to |
| 440 // Latin-1 if the string is not valid UTF-8. | 440 // Latin-1 if the string is not valid UTF-8. |
| 441 static String fromUTF8WithLatin1Fallback(const LChar*, size_t); | 441 static String fromUTF8WithLatin1Fallback(const LChar*, size_t); |
| 442 static String fromUTF8WithLatin1Fallback(const char* s, size_t length) { ret urn fromUTF8WithLatin1Fallback(reinterpret_cast<const LChar*>(s), length); } | 442 static String fromUTF8WithLatin1Fallback(const char* s, size_t length) { ret urn fromUTF8WithLatin1Fallback(reinterpret_cast<const LChar*>(s), length); } |
| 443 | 443 |
| 444 static String fromUTF8Lenient(const LChar* s, size_t length) { return fromU TF8(s, length, false); } | |
|
jsbell
2016/03/08 20:28:15
Please add documentation.
horo
2016/03/09 01:58:40
Done.
| |
| 445 static String fromUTF8Lenient(const char* s, size_t length) { return fromUTF 8Lenient(reinterpret_cast<const LChar*>(s), length); } | |
| 446 | |
| 444 bool containsOnlyASCII() const; | 447 bool containsOnlyASCII() const; |
| 445 bool containsOnlyLatin1() const; | 448 bool containsOnlyLatin1() const; |
| 446 bool containsOnlyWhitespace() const { return !m_impl || m_impl->containsOnly Whitespace(); } | 449 bool containsOnlyWhitespace() const { return !m_impl || m_impl->containsOnly Whitespace(); } |
| 447 | 450 |
| 448 // Hash table deleted values, which are only constructed and never copied or | 451 // Hash table deleted values, which are only constructed and never copied or |
| 449 // destroyed. | 452 // destroyed. |
| 450 String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { } | 453 String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { } |
| 451 bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue (); } | 454 bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue (); } |
| 452 | 455 |
| 453 #ifndef NDEBUG | 456 #ifndef NDEBUG |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 706 using WTF::charactersToFloat; | 709 using WTF::charactersToFloat; |
| 707 using WTF::equal; | 710 using WTF::equal; |
| 708 using WTF::equalIgnoringCase; | 711 using WTF::equalIgnoringCase; |
| 709 using WTF::find; | 712 using WTF::find; |
| 710 using WTF::isAllSpecialCharacters; | 713 using WTF::isAllSpecialCharacters; |
| 711 using WTF::isSpaceOrNewline; | 714 using WTF::isSpaceOrNewline; |
| 712 using WTF::reverseFind; | 715 using WTF::reverseFind; |
| 713 | 716 |
| 714 #include "wtf/text/AtomicString.h" | 717 #include "wtf/text/AtomicString.h" |
| 715 #endif // WTFString_h | 718 #endif // WTFString_h |
| OLD | NEW |