mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-22 01:34:21 +00:00
Major overhaul of the String class, to rely more heavily on the CharPointer_UTF classes. On win32, the juce_wchar type is now a typedef for a 32-bit int, rather than the 16-bit wchar_t. The String class now has toUTF8(), toUTF16() and toUTF32() methods to retrieve the string in different formats.
This commit is contained in:
parent
1b05a7d46d
commit
e235912ae5
79 changed files with 2765 additions and 2028 deletions
|
|
@ -317,27 +317,20 @@ const String StringArray::joinIntoString (const String& separator, int start, in
|
|||
String result;
|
||||
result.preallocateStorage (charsNeeded);
|
||||
|
||||
juce_wchar* dest = result;
|
||||
String::CharPointerType dest (result.getCharPointer());
|
||||
|
||||
while (start < last)
|
||||
{
|
||||
const String& s = strings.getReference (start);
|
||||
const int len = s.length();
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
s.copyToUnicode (dest, len);
|
||||
dest += len;
|
||||
}
|
||||
if (! s.isEmpty())
|
||||
dest.writeAll (s.getCharPointer());
|
||||
|
||||
if (++start < last && separatorLen > 0)
|
||||
{
|
||||
separator.copyToUnicode (dest, separatorLen);
|
||||
dest += separatorLen;
|
||||
}
|
||||
dest.writeAll (separator.getCharPointer());
|
||||
}
|
||||
|
||||
*dest = 0;
|
||||
dest.writeNull();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue