| 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 |
| 74 void String::append(const StringView& string) { | 84 void String::append(const StringView& string) { |
| 75 if (string.isEmpty()) | 85 if (string.isEmpty()) |
| 76 return; | 86 return; |
| 77 if (!m_impl) { | 87 if (!m_impl) { |
| 78 m_impl = string.toString().releaseImpl(); | 88 m_impl = string.toString().releaseImpl(); |
| 79 return; | 89 return; |
| 80 } | 90 } |
| 81 | 91 |
| 82 // FIXME: This is extremely inefficient. So much so that we might want to | 92 // FIXME: This is extremely inefficient. So much so that we might want to |
| 83 // take this out of String's API. We can make it better by optimizing the | 93 // 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... |
| 844 } | 854 } |
| 845 buffer.append('\0'); | 855 buffer.append('\0'); |
| 846 return buffer; | 856 return buffer; |
| 847 } | 857 } |
| 848 | 858 |
| 849 Vector<char> asciiDebug(String& string) { | 859 Vector<char> asciiDebug(String& string) { |
| 850 return asciiDebug(string.impl()); | 860 return asciiDebug(string.impl()); |
| 851 } | 861 } |
| 852 | 862 |
| 853 #endif | 863 #endif |
| OLD | NEW |