| 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 return true; | 674 return true; |
| 675 return false; | 675 return false; |
| 676 } | 676 } |
| 677 | 677 |
| 678 void String::split(const String& separator, bool allowEmptyEntries, Vector<Strin
g>& result) const | 678 void String::split(const String& separator, bool allowEmptyEntries, Vector<Strin
g>& result) const |
| 679 { | 679 { |
| 680 result.clear(); | 680 result.clear(); |
| 681 | 681 |
| 682 unsigned startPos = 0; | 682 unsigned startPos = 0; |
| 683 size_t endPos; | 683 size_t endPos; |
| 684 while ((endPos = find(separator, startPos)) != notFound) { | 684 while ((endPos = find(separator, startPos)) != kNotFound) { |
| 685 if (allowEmptyEntries || startPos != endPos) | 685 if (allowEmptyEntries || startPos != endPos) |
| 686 result.append(substring(startPos, endPos - startPos)); | 686 result.append(substring(startPos, endPos - startPos)); |
| 687 startPos = endPos + separator.length(); | 687 startPos = endPos + separator.length(); |
| 688 } | 688 } |
| 689 if (allowEmptyEntries || startPos != length()) | 689 if (allowEmptyEntries || startPos != length()) |
| 690 result.append(substring(startPos)); | 690 result.append(substring(startPos)); |
| 691 } | 691 } |
| 692 | 692 |
| 693 void String::split(UChar separator, bool allowEmptyEntries, Vector<String>& resu
lt) const | 693 void String::split(UChar separator, bool allowEmptyEntries, Vector<String>& resu
lt) const |
| 694 { | 694 { |
| 695 result.clear(); | 695 result.clear(); |
| 696 | 696 |
| 697 unsigned startPos = 0; | 697 unsigned startPos = 0; |
| 698 size_t endPos; | 698 size_t endPos; |
| 699 while ((endPos = find(separator, startPos)) != notFound) { | 699 while ((endPos = find(separator, startPos)) != kNotFound) { |
| 700 if (allowEmptyEntries || startPos != endPos) | 700 if (allowEmptyEntries || startPos != endPos) |
| 701 result.append(substring(startPos, endPos - startPos)); | 701 result.append(substring(startPos, endPos - startPos)); |
| 702 startPos = endPos + 1; | 702 startPos = endPos + 1; |
| 703 } | 703 } |
| 704 if (allowEmptyEntries || startPos != length()) | 704 if (allowEmptyEntries || startPos != length()) |
| 705 result.append(substring(startPos)); | 705 result.append(substring(startPos)); |
| 706 } | 706 } |
| 707 | 707 |
| 708 CString String::ascii() const | 708 CString String::ascii() const |
| 709 { | 709 { |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 buffer.append('\0'); | 1252 buffer.append('\0'); |
| 1253 return buffer; | 1253 return buffer; |
| 1254 } | 1254 } |
| 1255 | 1255 |
| 1256 Vector<char> asciiDebug(String& string) | 1256 Vector<char> asciiDebug(String& string) |
| 1257 { | 1257 { |
| 1258 return asciiDebug(string.impl()); | 1258 return asciiDebug(string.impl()); |
| 1259 } | 1259 } |
| 1260 | 1260 |
| 1261 #endif | 1261 #endif |
| OLD | NEW |