1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-19 01:04:20 +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:
Julian Storer 2010-02-21 19:04:41 +00:00
parent 038886510a
commit 6b79430341
75 changed files with 1371 additions and 1576 deletions

View file

@ -188,7 +188,7 @@ const File File::getSpecialLocation (const SpecialLocationType type)
homeDir = pw->pw_dir;
}
return File (String::fromUTF8 ((const uint8*) homeDir));
return File (String::fromUTF8 (homeDir));
}
case userDocumentsDirectory:
@ -223,7 +223,7 @@ const File File::getSpecialLocation (const SpecialLocationType type)
case invokedExecutableFile:
if (juce_Argv0 != 0)
return File (String::fromUTF8 ((const uint8*) juce_Argv0));
return File (String::fromUTF8 (juce_Argv0));
// deliberate fall-through...
case currentExecutableFile:
@ -248,11 +248,11 @@ const String File::getVersion() const
const File File::getLinkedTarget() const
{
char buffer [4096];
size_t numChars = readlink ((const char*) getFullPathName().toUTF8(),
size_t numChars = readlink (getFullPathName().toUTF8(),
buffer, sizeof (buffer));
if (numChars > 0 && numChars <= sizeof (buffer))
return File (String::fromUTF8 ((const uint8*) buffer, (int) numChars));
return File (String::fromUTF8 (buffer, (int) numChars));
return *this;
}
@ -295,7 +295,7 @@ struct FindFileStruct
if (fnmatch (wildcardUTF8, de->d_name, FNM_CASEFOLD) == 0)
{
result = String::fromUTF8 ((const uint8*) de->d_name);
result = String::fromUTF8 (de->d_name);
const String path (parentDir + result);