| 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, 2010, 2012 Apple Inc. All rights | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. All rights |
| 4 * reserved. | 4 * reserved. |
| 5 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 5 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Construct a string with latin1 data, from a null-terminated source. | 65 // Construct a string with latin1 data, from a null-terminated source. |
| 66 String::String(const LChar* characters) | 66 String::String(const LChar* characters) |
| 67 : m_impl(characters ? StringImpl::create(characters) : nullptr) {} | 67 : m_impl(characters ? StringImpl::create(characters) : nullptr) {} |
| 68 | 68 |
| 69 String::String(const char* characters) | 69 String::String(const char* characters) |
| 70 : m_impl(characters ? StringImpl::create( | 70 : m_impl(characters ? StringImpl::create( |
| 71 reinterpret_cast<const LChar*>(characters)) | 71 reinterpret_cast<const LChar*>(characters)) |
| 72 : nullptr) {} | 72 : nullptr) {} |
| 73 | 73 |
| 74 String::String(const String&) = default; | |
| 75 | |
| 76 String& String::operator=(const String&) = default; | |
| 77 | |
| 78 String::String(String&&) = default; | |
| 79 | |
| 80 String& String::operator=(String&&) = default; | |
| 81 | |
| 82 String::~String() {} | |
| 83 | |
| 84 void String::append(const StringView& string) { | 74 void String::append(const StringView& string) { |
| 85 if (string.isEmpty()) | 75 if (string.isEmpty()) |
| 86 return; | 76 return; |
| 87 if (!m_impl) { | 77 if (!m_impl) { |
| 88 m_impl = string.toString().releaseImpl(); | 78 m_impl = string.toString().releaseImpl(); |
| 89 return; | 79 return; |
| 90 } | 80 } |
| 91 | 81 |
| 92 // FIXME: This is extremely inefficient. So much so that we might want to | 82 // FIXME: This is extremely inefficient. So much so that we might want to |
| 93 // take this out of String's API. We can make it better by optimizing the | 83 // take this out of String's API. We can make it better by optimizing the |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 } | 844 } |
| 855 buffer.append('\0'); | 845 buffer.append('\0'); |
| 856 return buffer; | 846 return buffer; |
| 857 } | 847 } |
| 858 | 848 |
| 859 Vector<char> asciiDebug(String& string) { | 849 Vector<char> asciiDebug(String& string) { |
| 860 return asciiDebug(string.impl()); | 850 return asciiDebug(string.impl()); |
| 861 } | 851 } |
| 862 | 852 |
| 863 #endif | 853 #endif |
| OLD | NEW |