| 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. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 // Construct a string referencing an existing StringImpl. | 96 // Construct a string referencing an existing StringImpl. |
| 97 String(StringImpl* impl) : m_impl(impl) {} | 97 String(StringImpl* impl) : m_impl(impl) {} |
| 98 String(PassRefPtr<StringImpl> impl) : m_impl(impl) {} | 98 String(PassRefPtr<StringImpl> impl) : m_impl(impl) {} |
| 99 | 99 |
| 100 void swap(String& o) { m_impl.swap(o.m_impl); } | 100 void swap(String& o) { m_impl.swap(o.m_impl); } |
| 101 | 101 |
| 102 template <typename CharType> | 102 template <typename CharType> |
| 103 static String adopt(StringBuffer<CharType>& buffer) { | 103 static String adopt(StringBuffer<CharType>& buffer) { |
| 104 if (!buffer.length()) | 104 if (!buffer.length()) |
| 105 return StringImpl::empty(); | 105 return StringImpl::empty; |
| 106 return String(buffer.release()); | 106 return String(buffer.release()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool isNull() const { return !m_impl; } | 109 bool isNull() const { return !m_impl; } |
| 110 bool isEmpty() const { return !m_impl || !m_impl->length(); } | 110 bool isEmpty() const { return !m_impl || !m_impl->length(); } |
| 111 | 111 |
| 112 StringImpl* impl() const { return m_impl.get(); } | 112 StringImpl* impl() const { return m_impl.get(); } |
| 113 PassRefPtr<StringImpl> releaseImpl() { return m_impl.release(); } | 113 PassRefPtr<StringImpl> releaseImpl() { return m_impl.release(); } |
| 114 | 114 |
| 115 unsigned length() const { | 115 unsigned length() const { |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 487 |
| 488 inline void swap(String& a, String& b) { | 488 inline void swap(String& a, String& b) { |
| 489 a.swap(b); | 489 a.swap(b); |
| 490 } | 490 } |
| 491 | 491 |
| 492 // Definitions of string operations | 492 // Definitions of string operations |
| 493 | 493 |
| 494 template <size_t inlineCapacity> | 494 template <size_t inlineCapacity> |
| 495 String::String(const Vector<UChar, inlineCapacity>& vector) | 495 String::String(const Vector<UChar, inlineCapacity>& vector) |
| 496 : m_impl(vector.size() ? StringImpl::create(vector.data(), vector.size()) | 496 : m_impl(vector.size() ? StringImpl::create(vector.data(), vector.size()) |
| 497 : StringImpl::empty()) {} | 497 : StringImpl::empty) {} |
| 498 | 498 |
| 499 template <> | 499 template <> |
| 500 inline const LChar* String::getCharacters<LChar>() const { | 500 inline const LChar* String::getCharacters<LChar>() const { |
| 501 DCHECK(is8Bit()); | 501 DCHECK(is8Bit()); |
| 502 return characters8(); | 502 return characters8(); |
| 503 } | 503 } |
| 504 | 504 |
| 505 template <> | 505 template <> |
| 506 inline const UChar* String::getCharacters<UChar>() const { | 506 inline const UChar* String::getCharacters<UChar>() const { |
| 507 DCHECK(!is8Bit()); | 507 DCHECK(!is8Bit()); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 using WTF::String; | 598 using WTF::String; |
| 599 using WTF::emptyString; | 599 using WTF::emptyString; |
| 600 using WTF::emptyString16Bit; | 600 using WTF::emptyString16Bit; |
| 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::isSpaceOrNewline; | 604 using WTF::isSpaceOrNewline; |
| 605 | 605 |
| 606 #include "wtf/text/AtomicString.h" | 606 #include "wtf/text/AtomicString.h" |
| 607 #endif // WTFString_h | 607 #endif // WTFString_h |
| OLD | NEW |