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; } | |
Inactive
2014/07/21 11:15:43
Mikhail, are you sure about this? I thought the mo
Mikhail
2014/07/21 12:35:44
Thanks for catching this, Chris! The thing is that
| |
133 #endif | |
134 | |
135 // Inline the destructor. | 126 // Inline the destructor. |
136 ALWAYS_INLINE ~String() { } | 127 ALWAYS_INLINE ~String() { } |
137 | 128 |
138 void swap(String& o) { m_impl.swap(o.m_impl); } | 129 void swap(String& o) { m_impl.swap(o.m_impl); } |
139 | 130 |
140 template<typename CharType> | 131 template<typename CharType> |
141 static String adopt(StringBuffer<CharType>& buffer) | 132 static String adopt(StringBuffer<CharType>& buffer) |
142 { | 133 { |
143 if (!buffer.length()) | 134 if (!buffer.length()) |
144 return StringImpl::empty(); | 135 return StringImpl::empty(); |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
701 using WTF::charactersToFloat; | 692 using WTF::charactersToFloat; |
702 using WTF::equal; | 693 using WTF::equal; |
703 using WTF::equalIgnoringCase; | 694 using WTF::equalIgnoringCase; |
704 using WTF::find; | 695 using WTF::find; |
705 using WTF::isAllSpecialCharacters; | 696 using WTF::isAllSpecialCharacters; |
706 using WTF::isSpaceOrNewline; | 697 using WTF::isSpaceOrNewline; |
707 using WTF::reverseFind; | 698 using WTF::reverseFind; |
708 | 699 |
709 #include "wtf/text/AtomicString.h" | 700 #include "wtf/text/AtomicString.h" |
710 #endif // WTFString_h | 701 #endif // WTFString_h |
OLD | NEW |