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) | 126 #if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) && COMPILER_SUPPORTS(CXX_DEFAULTED_
FUNCTIONS) |
127 // We have to declare the copy constructor and copy assignment operator as w
ell, otherwise | 127 // We have to explicitly declare the move constructor and move copy assignme
nt operator. The compiler does |
128 // they'll be implicitly deleted by adding the move constructor and move ass
ignment operator. | 128 // not generate them because the class has an explicitly defined destructor. |
129 String(const String& other) : m_impl(other.m_impl) { } | 129 String(const String&) = default; |
130 String(String&& other) : m_impl(other.m_impl.release()) { } | 130 String(String&&) = default; |
131 String& operator=(const String& other) { m_impl = other.m_impl; return *this
; } | 131 String& operator=(const String&) = default; |
132 String& operator=(String&& other) { m_impl = other.m_impl.release(); return
*this; } | 132 String& operator=(String&&) = default; |
133 #endif | 133 #endif |
134 | 134 |
135 // Inline the destructor. | 135 // Inline the destructor. |
136 ALWAYS_INLINE ~String() { } | 136 ALWAYS_INLINE ~String() { } |
137 | 137 |
138 void swap(String& o) { m_impl.swap(o.m_impl); } | 138 void swap(String& o) { m_impl.swap(o.m_impl); } |
139 | 139 |
140 template<typename CharType> | 140 template<typename CharType> |
141 static String adopt(StringBuffer<CharType>& buffer) | 141 static String adopt(StringBuffer<CharType>& buffer) |
142 { | 142 { |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 using WTF::charactersToFloat; | 701 using WTF::charactersToFloat; |
702 using WTF::equal; | 702 using WTF::equal; |
703 using WTF::equalIgnoringCase; | 703 using WTF::equalIgnoringCase; |
704 using WTF::find; | 704 using WTF::find; |
705 using WTF::isAllSpecialCharacters; | 705 using WTF::isAllSpecialCharacters; |
706 using WTF::isSpaceOrNewline; | 706 using WTF::isSpaceOrNewline; |
707 using WTF::reverseFind; | 707 using WTF::reverseFind; |
708 | 708 |
709 #include "wtf/text/AtomicString.h" | 709 #include "wtf/text/AtomicString.h" |
710 #endif // WTFString_h | 710 #endif // WTFString_h |
OLD | NEW |