mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-16 00:34:19 +00:00
Refactored some String operators to bring them into line with c++ best practices. Removed the JUCE_STRINGS_ARE_UNICODE flag - all strings are now unicode by default. Removed the String class's implicit cast to const char* and copyToBuffer() method, replacing them with toCString(), toUTF8(), copyToCString(), copyToUnicode(), etc., so that it'll force users to think about the encoding they want to use in a particular context. Added the ability to pass a String directly to a std::ostream. Extended the juce version number to include a build number.
This commit is contained in:
parent
038886510a
commit
6b79430341
75 changed files with 1371 additions and 1576 deletions
|
|
@ -302,7 +302,7 @@ const String StringArray::joinIntoString (const String& separator, int start, in
|
|||
String result;
|
||||
result.preallocateStorage (charsNeeded);
|
||||
|
||||
tchar* dest = (tchar*) (const tchar*) result;
|
||||
juce_wchar* dest = (juce_wchar*) result;
|
||||
|
||||
while (start < last)
|
||||
{
|
||||
|
|
@ -311,13 +311,13 @@ const String StringArray::joinIntoString (const String& separator, int start, in
|
|||
|
||||
if (len > 0)
|
||||
{
|
||||
s.copyToBuffer (dest, len);
|
||||
s.copyToUnicode (dest, len);
|
||||
dest += len;
|
||||
}
|
||||
|
||||
if (++start < last && separatorLen > 0)
|
||||
{
|
||||
separator.copyToBuffer (dest, separatorLen);
|
||||
separator.copyToUnicode (dest, separatorLen);
|
||||
dest += separatorLen;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue