| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 Vector<char> buffer; | 51 Vector<char> buffer; |
| 52 for (unsigned i = 0; i < impl->length(); ++i) { | 52 for (unsigned i = 0; i < impl->length(); ++i) { |
| 53 UChar ch = (*impl)[i]; | 53 UChar ch = (*impl)[i]; |
| 54 if (isASCIIPrintable(ch)) { | 54 if (isASCIIPrintable(ch)) { |
| 55 if (ch == '\\') | 55 if (ch == '\\') |
| 56 buffer.push_back('\\'); | 56 buffer.push_back('\\'); |
| 57 buffer.push_back(static_cast<char>(ch)); | 57 buffer.push_back(static_cast<char>(ch)); |
| 58 } else { | 58 } else { |
| 59 buffer.push_back('\\'); | 59 buffer.push_back('\\'); |
| 60 buffer.push_back('u'); | 60 buffer.push_back('u'); |
| 61 appendUnsignedAsHexFixedSize(ch, buffer, 4); | 61 HexNumber::appendUnsignedAsHexFixedSize(ch, buffer, 4); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 buffer.push_back('\0'); | 64 buffer.push_back('\0'); |
| 65 return buffer; | 65 return buffer; |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace | 68 } // namespace |
| 69 | 69 |
| 70 // Construct a string with UTF-16 data. | 70 // Construct a string with UTF-16 data. |
| 71 String::String(const UChar* characters, unsigned length) | 71 String::String(const UChar* characters, unsigned length) |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 return out << '"'; | 836 return out << '"'; |
| 837 } | 837 } |
| 838 | 838 |
| 839 #ifndef NDEBUG | 839 #ifndef NDEBUG |
| 840 void String::show() const { | 840 void String::show() const { |
| 841 dataLogF("%s\n", asciiDebug(impl()).data()); | 841 dataLogF("%s\n", asciiDebug(impl()).data()); |
| 842 } | 842 } |
| 843 #endif | 843 #endif |
| 844 | 844 |
| 845 } // namespace WTF | 845 } // namespace WTF |
| OLD | NEW |