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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 String(const char* characters, unsigned length); | 116 String(const char* characters, unsigned length); |
117 | 117 |
118 // Construct a string with latin1 data, from a null-terminated source. | 118 // Construct a string with latin1 data, from a null-terminated source. |
119 String(const LChar* characters); | 119 String(const LChar* characters); |
120 String(const char* characters); | 120 String(const char* characters); |
121 | 121 |
122 // Construct a string referencing an existing StringImpl. | 122 // Construct a string referencing an existing StringImpl. |
123 String(StringImpl* impl) : m_impl(impl) { } | 123 String(StringImpl* impl) : m_impl(impl) { } |
124 String(PassRefPtr<StringImpl> impl) : m_impl(impl) { } | 124 String(PassRefPtr<StringImpl> impl) : m_impl(impl) { } |
125 | 125 |
| 126 #if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) |
| 127 // We have to declare the copy constructor and copy assignment operator as w
ell, otherwise |
| 128 // they'll be implicitly deleted by adding the move constructor and move ass
ignment operator. |
| 129 String(const String& other) : m_impl(other.m_impl) { } |
| 130 String(String&& other) : m_impl(other.m_impl.release()) { } |
| 131 String& operator=(const String& other) { m_impl = other.m_impl; return *this
; } |
| 132 String& operator=(String&& other) { m_impl = other.m_impl.release(); return
*this; } |
| 133 #endif |
| 134 |
126 // Inline the destructor. | 135 // Inline the destructor. |
127 ALWAYS_INLINE ~String() { } | 136 ALWAYS_INLINE ~String() { } |
128 | 137 |
129 void swap(String& o) { m_impl.swap(o.m_impl); } | 138 void swap(String& o) { m_impl.swap(o.m_impl); } |
130 | 139 |
131 template<typename CharType> | 140 template<typename CharType> |
132 static String adopt(StringBuffer<CharType>& buffer) | 141 static String adopt(StringBuffer<CharType>& buffer) |
133 { | 142 { |
134 if (!buffer.length()) | 143 if (!buffer.length()) |
135 return StringImpl::empty(); | 144 return StringImpl::empty(); |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 using WTF::charactersToFloat; | 701 using WTF::charactersToFloat; |
693 using WTF::equal; | 702 using WTF::equal; |
694 using WTF::equalIgnoringCase; | 703 using WTF::equalIgnoringCase; |
695 using WTF::find; | 704 using WTF::find; |
696 using WTF::isAllSpecialCharacters; | 705 using WTF::isAllSpecialCharacters; |
697 using WTF::isSpaceOrNewline; | 706 using WTF::isSpaceOrNewline; |
698 using WTF::reverseFind; | 707 using WTF::reverseFind; |
699 | 708 |
700 #include "wtf/text/AtomicString.h" | 709 #include "wtf/text/AtomicString.h" |
701 #endif // WTFString_h | 710 #endif // WTFString_h |
OLD | NEW |