| 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
reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. All rights
reserved. |
| 4 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 4 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 // There should be room left, since one UChar hasn't been conver
ted. | 864 // There should be room left, since one UChar hasn't been conver
ted. |
| 865 ASSERT((buffer + 3) <= (buffer + bufferVector.size())); | 865 ASSERT((buffer + 3) <= (buffer + bufferVector.size())); |
| 866 putUTF8Triple(buffer, *characters); | 866 putUTF8Triple(buffer, *characters); |
| 867 } | 867 } |
| 868 } | 868 } |
| 869 } | 869 } |
| 870 | 870 |
| 871 return CString(bufferVector.data(), buffer - bufferVector.data()); | 871 return CString(bufferVector.data(), buffer - bufferVector.data()); |
| 872 } | 872 } |
| 873 | 873 |
| 874 std::string String::toUTF8() const |
| 875 { |
| 876 return utf8().toStdString(); |
| 877 } |
| 878 |
| 874 String String::make8BitFrom16BitSource(const UChar* source, size_t length) | 879 String String::make8BitFrom16BitSource(const UChar* source, size_t length) |
| 875 { | 880 { |
| 876 if (!length) | 881 if (!length) |
| 877 return emptyString(); | 882 return emptyString(); |
| 878 | 883 |
| 879 LChar* destination; | 884 LChar* destination; |
| 880 String result = String::createUninitialized(length, destination); | 885 String result = String::createUninitialized(length, destination); |
| 881 | 886 |
| 882 copyLCharsFromUCharSource(destination, source, length); | 887 copyLCharsFromUCharSource(destination, source, length); |
| 883 | 888 |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 buffer.append('\0'); | 1271 buffer.append('\0'); |
| 1267 return buffer; | 1272 return buffer; |
| 1268 } | 1273 } |
| 1269 | 1274 |
| 1270 Vector<char> asciiDebug(String& string) | 1275 Vector<char> asciiDebug(String& string) |
| 1271 { | 1276 { |
| 1272 return asciiDebug(string.impl()); | 1277 return asciiDebug(string.impl()); |
| 1273 } | 1278 } |
| 1274 | 1279 |
| 1275 #endif | 1280 #endif |
| OLD | NEW |