1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Removed a few more uses of String::empty.

This commit is contained in:
jules 2013-12-01 23:28:31 +00:00
parent 2623f4d1e1
commit 2edec00b55
46 changed files with 91 additions and 91 deletions

View file

@ -265,7 +265,7 @@ void ComponentLayout::copySelectedToClipboard()
} }
} }
SystemClipboard::copyTextToClipboard (clip.createDocument (String::empty, false, false)); SystemClipboard::copyTextToClipboard (clip.createDocument ("", false, false));
} }
void ComponentLayout::paste() void ComponentLayout::paste()

View file

@ -441,7 +441,7 @@ void JucerDocument::fillInGeneratedCode (GeneratedCode& code) const
ScopedPointer<XmlElement> e (createXml()); ScopedPointer<XmlElement> e (createXml());
jassert (e != nullptr); jassert (e != nullptr);
code.jucerMetadata = e->createDocument (String::empty, false, false); code.jucerMetadata = e->createDocument ("", false, false);
resources.fillInGeneratedCode (code); resources.fillInGeneratedCode (code);

View file

@ -304,7 +304,7 @@ void PaintRoutine::copySelectedToClipboard()
} }
} }
SystemClipboard::copyTextToClipboard (clip.createDocument (String::empty, false, false)); SystemClipboard::copyTextToClipboard (clip.createDocument ("", false, false));
} }
void PaintRoutine::paste() void PaintRoutine::paste()

View file

@ -408,15 +408,15 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup
jassert (&newSetup != &currentSetup); // this will have no effect jassert (&newSetup != &currentSetup); // this will have no effect
if (newSetup == currentSetup && currentAudioDevice != nullptr) if (newSetup == currentSetup && currentAudioDevice != nullptr)
return String::empty; return String();
if (! (newSetup == currentSetup)) if (! (newSetup == currentSetup))
sendChangeMessage(); sendChangeMessage();
stopDevice(); stopDevice();
const String newInputDeviceName (numInputChansNeeded == 0 ? String::empty : newSetup.inputDeviceName); const String newInputDeviceName (numInputChansNeeded == 0 ? String() : newSetup.inputDeviceName);
const String newOutputDeviceName (numOutputChansNeeded == 0 ? String::empty : newSetup.outputDeviceName); const String newOutputDeviceName (numOutputChansNeeded == 0 ? String() : newSetup.outputDeviceName);
String error; String error;
AudioIODeviceType* type = getCurrentDeviceTypeObject(); AudioIODeviceType* type = getCurrentDeviceTypeObject();
@ -428,7 +428,7 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup
if (treatAsChosenDevice) if (treatAsChosenDevice)
updateXml(); updateXml();
return String::empty; return String();
} }
if (currentSetup.inputDeviceName != newInputDeviceName if (currentSetup.inputDeviceName != newInputDeviceName

View file

@ -46,7 +46,7 @@ public:
{ {
// OpenSL has piss-poor support for determining latency, so the only way I can find to // OpenSL has piss-poor support for determining latency, so the only way I can find to
// get a number for this is by asking the AudioTrack/AudioRecord classes.. // get a number for this is by asking the AudioTrack/AudioRecord classes..
AndroidAudioIODevice javaDevice (String::empty); AndroidAudioIODevice javaDevice (String());
// this is a total guess about how to calculate the latency, but seems to vaguely agree // this is a total guess about how to calculate the latency, but seems to vaguely agree
// with the devices I've tested.. YMMV // with the devices I've tested.. YMMV

View file

@ -343,7 +343,7 @@ namespace AiffFileHelpers
out.writeIntBigEndian (values.getValue (prefix + "TimeStamp", "0").getIntValue()); out.writeIntBigEndian (values.getValue (prefix + "TimeStamp", "0").getIntValue());
out.writeShortBigEndian ((short) values.getValue (prefix + "Identifier", "0").getIntValue()); out.writeShortBigEndian ((short) values.getValue (prefix + "Identifier", "0").getIntValue());
const String comment (values.getValue (prefix + "Text", String::empty)); const String comment (values.getValue (prefix + "Text", String()));
const size_t commentLength = jmin (comment.getNumBytesAsUTF8(), (size_t) 65534); const size_t commentLength = jmin (comment.getNumBytesAsUTF8(), (size_t) 65534);
out.writeShortBigEndian ((short) commentLength + 1); out.writeShortBigEndian ((short) commentLength + 1);

View file

@ -72,7 +72,7 @@ public:
void addMetadataArg (const StringPairArray& metadata, const char* key, const char* lameFlag) void addMetadataArg (const StringPairArray& metadata, const char* key, const char* lameFlag)
{ {
const String value (metadata.getValue (key, String::empty)); const String value (metadata.getValue (key, String()));
if (value.isNotEmpty()) if (value.isNotEmpty())
{ {

View file

@ -136,7 +136,7 @@ namespace AudioUnitFormatHelpers
fileOrIdentifier.lastIndexOfChar ('/')) + 1)); fileOrIdentifier.lastIndexOfChar ('/')) + 1));
StringArray tokens; StringArray tokens;
tokens.addTokens (s, ",", String::empty); tokens.addTokens (s, ",", String());
tokens.removeEmptyStrings(); tokens.removeEmptyStrings();
if (tokens.size() == 3) if (tokens.size() == 3)
@ -570,7 +570,7 @@ public:
if (isPositiveAndBelow (index, getNumInputChannels())) if (isPositiveAndBelow (index, getNumInputChannels()))
return "Input " + String (index + 1); return "Input " + String (index + 1);
return String::empty; return String();
} }
const String getOutputChannelName (int index) const override const String getOutputChannelName (int index) const override
@ -578,7 +578,7 @@ public:
if (isPositiveAndBelow (index, getNumOutputChannels())) if (isPositiveAndBelow (index, getNumOutputChannels()))
return "Output " + String (index + 1); return "Output " + String (index + 1);
return String::empty; return String();
} }
bool isInputChannelStereoPair (int index) const override { return isPositiveAndBelow (index, getNumInputChannels()); } bool isInputChannelStereoPair (int index) const override { return isPositiveAndBelow (index, getNumInputChannels()); }
@ -652,7 +652,7 @@ public:
if (const ParamInfo* p = parameters[index]) if (const ParamInfo* p = parameters[index])
return p->name; return p->name;
return String::empty; return String();
} }
const String getParameterText (int index) override { return String (getParameter (index)); } const String getParameterText (int index) override { return String (getParameter (index)); }

View file

@ -222,7 +222,7 @@ public:
desc.lastFileModTime = module->file.getLastModificationTime(); desc.lastFileModTime = module->file.getLastModificationTime();
desc.pluginFormatName = "LADSPA"; desc.pluginFormatName = "LADSPA";
desc.category = getCategory(); desc.category = getCategory();
desc.manufacturerName = plugin != nullptr ? String (plugin->Maker) : String::empty; desc.manufacturerName = plugin != nullptr ? String (plugin->Maker) : String();
desc.version = getVersion(); desc.version = getVersion();
desc.numInputChannels = getNumInputChannels(); desc.numInputChannels = getNumInputChannels();
desc.numOutputChannels = getNumOutputChannels(); desc.numOutputChannels = getNumOutputChannels();
@ -338,7 +338,7 @@ public:
if (isPositiveAndBelow (index, getNumInputChannels())) if (isPositiveAndBelow (index, getNumInputChannels()))
return String (plugin->PortNames [inputs [index]]).trim(); return String (plugin->PortNames [inputs [index]]).trim();
return String::empty; return String();
} }
const String getOutputChannelName (const int index) const const String getOutputChannelName (const int index) const
@ -346,7 +346,7 @@ public:
if (isPositiveAndBelow (index, getNumInputChannels())) if (isPositiveAndBelow (index, getNumInputChannels()))
return String (plugin->PortNames [outputs [index]]).trim(); return String (plugin->PortNames [outputs [index]]).trim();
return String::empty; return String();
} }
//============================================================================== //==============================================================================
@ -390,7 +390,7 @@ public:
return String (plugin->PortNames [parameters [index]]).trim(); return String (plugin->PortNames [parameters [index]]).trim();
} }
return String::empty; return String();
} }
const String getParameterText (int index) const String getParameterText (int index)
@ -407,7 +407,7 @@ public:
return String (parameterValues[index].scaled, 4); return String (parameterValues[index].scaled, 4);
} }
return String::empty; return String();
} }
//============================================================================== //==============================================================================
@ -424,7 +424,7 @@ public:
const String getProgramName (int index) const String getProgramName (int index)
{ {
// XXX // XXX
return String::empty; return String();
} }
void changeProgramName (int index, const String& newName) void changeProgramName (int index, const String& newName)

View file

@ -201,7 +201,7 @@ void AudioProcessor::updateHostDisplay()
l->audioProcessorChanged (this); l->audioProcessorChanged (this);
} }
String AudioProcessor::getParameterLabel (int) const { return String::empty; } String AudioProcessor::getParameterLabel (int) const { return String(); }
bool AudioProcessor::isParameterAutomatable (int) const { return true; } bool AudioProcessor::isParameterAutomatable (int) const { return true; }
bool AudioProcessor::isMetaParameter (int) const { return false; } bool AudioProcessor::isMetaParameter (int) const { return false; }
@ -266,7 +266,7 @@ void AudioProcessor::copyXmlToBinary (const XmlElement& xml, juce::MemoryBlock&
MemoryOutputStream out (destData, false); MemoryOutputStream out (destData, false);
out.writeInt (magicXmlNumber); out.writeInt (magicXmlNumber);
out.writeInt (0); out.writeInt (0);
xml.writeToStream (out, String::empty, true, false); xml.writeToStream (out, String(), true, false);
out.writeByte (0); out.writeByte (0);
} }

View file

@ -1367,7 +1367,7 @@ const String AudioProcessorGraph::AudioGraphIOProcessor::getName() const
default: break; default: break;
} }
return String::empty; return String();
} }
void AudioProcessorGraph::AudioGraphIOProcessor::fillInPluginDescription (PluginDescription& d) const void AudioProcessorGraph::AudioGraphIOProcessor::fillInPluginDescription (PluginDescription& d) const
@ -1469,7 +1469,7 @@ const String AudioProcessorGraph::AudioGraphIOProcessor::getInputChannelName (in
default: break; default: break;
} }
return String::empty; return String();
} }
const String AudioProcessorGraph::AudioGraphIOProcessor::getOutputChannelName (int channelIndex) const const String AudioProcessorGraph::AudioGraphIOProcessor::getOutputChannelName (int channelIndex) const
@ -1481,7 +1481,7 @@ const String AudioProcessorGraph::AudioGraphIOProcessor::getOutputChannelName (i
default: break; default: break;
} }
return String::empty; return String();
} }
bool AudioProcessorGraph::AudioGraphIOProcessor::isInputChannelStereoPair (int /*index*/) const bool AudioProcessorGraph::AudioGraphIOProcessor::isInputChannelStereoPair (int /*index*/) const
@ -1501,17 +1501,17 @@ bool AudioProcessorGraph::AudioGraphIOProcessor::hasEditor() const
AudioProcessorEditor* AudioProcessorGraph::AudioGraphIOProcessor::createEditor() { return nullptr; } AudioProcessorEditor* AudioProcessorGraph::AudioGraphIOProcessor::createEditor() { return nullptr; }
int AudioProcessorGraph::AudioGraphIOProcessor::getNumParameters() { return 0; } int AudioProcessorGraph::AudioGraphIOProcessor::getNumParameters() { return 0; }
const String AudioProcessorGraph::AudioGraphIOProcessor::getParameterName (int) { return String::empty; } const String AudioProcessorGraph::AudioGraphIOProcessor::getParameterName (int) { return String(); }
float AudioProcessorGraph::AudioGraphIOProcessor::getParameter (int) { return 0.0f; } float AudioProcessorGraph::AudioGraphIOProcessor::getParameter (int) { return 0.0f; }
const String AudioProcessorGraph::AudioGraphIOProcessor::getParameterText (int) { return String::empty; } const String AudioProcessorGraph::AudioGraphIOProcessor::getParameterText (int) { return String(); }
void AudioProcessorGraph::AudioGraphIOProcessor::setParameter (int, float) { } void AudioProcessorGraph::AudioGraphIOProcessor::setParameter (int, float) { }
int AudioProcessorGraph::AudioGraphIOProcessor::getNumPrograms() { return 0; } int AudioProcessorGraph::AudioGraphIOProcessor::getNumPrograms() { return 0; }
int AudioProcessorGraph::AudioGraphIOProcessor::getCurrentProgram() { return 0; } int AudioProcessorGraph::AudioGraphIOProcessor::getCurrentProgram() { return 0; }
void AudioProcessorGraph::AudioGraphIOProcessor::setCurrentProgram (int) { } void AudioProcessorGraph::AudioGraphIOProcessor::setCurrentProgram (int) { }
const String AudioProcessorGraph::AudioGraphIOProcessor::getProgramName (int) { return String::empty; } const String AudioProcessorGraph::AudioGraphIOProcessor::getProgramName (int) { return String(); }
void AudioProcessorGraph::AudioGraphIOProcessor::changeProgramName (int, const String&) {} void AudioProcessorGraph::AudioGraphIOProcessor::changeProgramName (int, const String&) {}
void AudioProcessorGraph::AudioGraphIOProcessor::getStateInformation (juce::MemoryBlock&) {} void AudioProcessorGraph::AudioGraphIOProcessor::getStateInformation (juce::MemoryBlock&) {}

View file

@ -372,15 +372,15 @@ public:
AudioProcessorEditor* createEditor() { return nullptr; } AudioProcessorEditor* createEditor() { return nullptr; }
int getNumParameters() { return 0; } int getNumParameters() { return 0; }
const String getParameterName (int) { return String::empty; } const String getParameterName (int) { return String(); }
float getParameter (int) { return 0; } float getParameter (int) { return 0; }
const String getParameterText (int) { return String::empty; } const String getParameterText (int) { return String(); }
void setParameter (int, float) { } void setParameter (int, float) { }
int getNumPrograms() { return 0; } int getNumPrograms() { return 0; }
int getCurrentProgram() { return 0; } int getCurrentProgram() { return 0; }
void setCurrentProgram (int) { } void setCurrentProgram (int) { }
const String getProgramName (int) { return String::empty; } const String getProgramName (int) { return String(); }
void changeProgramName (int, const String&) { } void changeProgramName (int, const String&) { }
void getStateInformation (juce::MemoryBlock&); void getStateInformation (juce::MemoryBlock&);

View file

@ -156,7 +156,7 @@ void PropertySet::removeValue (StringRef keyName)
void PropertySet::setValue (const String& keyName, const XmlElement* const xml) void PropertySet::setValue (const String& keyName, const XmlElement* const xml)
{ {
setValue (keyName, xml == nullptr ? var::null setValue (keyName, xml == nullptr ? var::null
: var (xml->createDocument (String::empty, true))); : var (xml->createDocument ("", true)));
} }
bool PropertySet::containsKey (StringRef keyName) const noexcept bool PropertySet::containsKey (StringRef keyName) const noexcept

View file

@ -69,7 +69,7 @@ public:
@param keyName the name of the property to retrieve @param keyName the name of the property to retrieve
@param defaultReturnValue a value to return if the named property doesn't actually exist @param defaultReturnValue a value to return if the named property doesn't actually exist
*/ */
String getValue (StringRef keyName, const String& defaultReturnValue = String::empty) const noexcept; String getValue (StringRef keyName, const String& defaultReturnValue = String()) const noexcept;
/** Returns one of the properties as an integer. /** Returns one of the properties as an integer.

View file

@ -75,7 +75,7 @@ const File File::nonexistent;
String File::parseAbsolutePath (const String& p) String File::parseAbsolutePath (const String& p)
{ {
if (p.isEmpty()) if (p.isEmpty())
return String::empty; return String();
#if JUCE_WINDOWS #if JUCE_WINDOWS
// Windows.. // Windows..
@ -482,11 +482,11 @@ bool File::loadFileAsData (MemoryBlock& destBlock) const
String File::loadFileAsString() const String File::loadFileAsString() const
{ {
if (! existsAsFile()) if (! existsAsFile())
return String::empty; return String();
FileInputStream in (*this); FileInputStream in (*this);
return in.openedOk() ? in.readEntireStreamAsString() return in.openedOk() ? in.readEntireStreamAsString()
: String::empty; : String();
} }
void File::readLines (StringArray& destLines) const void File::readLines (StringArray& destLines) const
@ -598,7 +598,7 @@ String File::getFileExtension() const
if (indexOfDot > fullPath.lastIndexOfChar (separator)) if (indexOfDot > fullPath.lastIndexOfChar (separator))
return fullPath.substring (indexOfDot); return fullPath.substring (indexOfDot);
return String::empty; return String();
} }
bool File::hasFileExtension (StringRef possibleSuffix) const bool File::hasFileExtension (StringRef possibleSuffix) const

View file

@ -89,7 +89,7 @@ public:
The file will not be created until you write to it. And remember that when The file will not be created until you write to it. And remember that when
this object is deleted, the file will also be deleted! this object is deleted, the file will also be deleted!
*/ */
TemporaryFile (const String& suffix = String::empty, TemporaryFile (const String& suffix = String(),
int optionFlags = 0); int optionFlags = 0);
/** Creates a temporary file in the same directory as a specified file. /** Creates a temporary file in the same directory as a specified file.

View file

@ -951,7 +951,7 @@ String BigInteger::toString (const int base, const int minimumNumCharacters) con
else else
{ {
jassertfalse; // can't do the specified base! jassertfalse; // can't do the specified base!
return String::empty; return String();
} }
s = s.paddedLeft ('0', minimumNumCharacters); s = s.paddedLeft ('0', minimumNumCharacters);

View file

@ -53,7 +53,7 @@ public:
virtual String getName() const virtual String getName() const
{ {
jassertfalse; // You shouldn't call this for an expression that's not actually a function! jassertfalse; // You shouldn't call this for an expression that's not actually a function!
return String::empty; return String();
} }
virtual void renameSymbol (const Symbol& oldSymbol, const String& newName, const Scope& scope, int recursionDepth) virtual void renameSymbol (const Symbol& oldSymbol, const String& newName, const Scope& scope, int recursionDepth)
@ -1181,5 +1181,5 @@ void Expression::Scope::visitRelativeScope (const String& scopeName, Visitor&) c
String Expression::Scope::getScopeUID() const String Expression::Scope::getScopeUID() const
{ {
return String::empty; return String();
} }

View file

@ -72,7 +72,7 @@ bool File::isOnRemovableDrive() const
String File::getVersion() const String File::getVersion() const
{ {
return String::empty; // xxx not yet implemented return String(); // xxx not yet implemented
} }
//============================================================================== //==============================================================================

View file

@ -309,7 +309,7 @@ private:
{ {
char c = 0; char c = 0;
if (read (&c, 1) != 1) if (read (&c, 1) != 1)
return String::empty; return String();
buffer.writeByte (c); buffer.writeByte (c);
@ -324,7 +324,7 @@ private:
if (header.startsWithIgnoreCase ("HTTP/")) if (header.startsWithIgnoreCase ("HTTP/"))
return header; return header;
return String::empty; return String();
} }
static void writeValueIfNotPresent (MemoryOutputStream& dest, const String& headers, const String& key, const String& value) static void writeValueIfNotPresent (MemoryOutputStream& dest, const String& headers, const String& key, const String& value)
@ -432,7 +432,7 @@ private:
if (lines[i].startsWithIgnoreCase (itemName)) if (lines[i].startsWithIgnoreCase (itemName))
return lines[i].substring (itemName.length()).trim(); return lines[i].substring (itemName.length()).trim();
return String::empty; return String();
} }
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream)

View file

@ -44,7 +44,7 @@ String SystemStats::getOperatingSystemName()
String SystemStats::getDeviceDescription() String SystemStats::getDeviceDescription()
{ {
return String::empty; return String();
} }
bool SystemStats::isOperatingSystem64Bit() bool SystemStats::isOperatingSystem64Bit()
@ -69,7 +69,7 @@ namespace LinuxStatsHelpers
if (lines[i].startsWithIgnoreCase (key)) if (lines[i].startsWithIgnoreCase (key))
return lines[i].fromFirstOccurrenceOf (":", false, false).trim(); return lines[i].fromFirstOccurrenceOf (":", false, false).trim();
return String::empty; return String();
} }
} }
@ -107,7 +107,7 @@ String SystemStats::getLogonName()
if (struct passwd* const pw = getpwuid (getuid())) if (struct passwd* const pw = getpwuid (getuid()))
return CharPointer_UTF8 (pw->pw_name); return CharPointer_UTF8 (pw->pw_name);
return String::empty; return String();
} }
String SystemStats::getFullUserName() String SystemStats::getFullUserName()
@ -121,7 +121,7 @@ String SystemStats::getComputerName()
if (gethostname (name, sizeof (name) - 1) == 0) if (gethostname (name, sizeof (name) - 1) == 0)
return name; return name;
return String::empty; return String();
} }
static String getLocaleValue (nl_item key) static String getLocaleValue (nl_item key)

View file

@ -271,7 +271,7 @@ String File::getVersion() const
return nsStringToJuce (name); return nsStringToJuce (name);
} }
return String::empty; return String();
} }
//============================================================================== //==============================================================================

View file

@ -29,7 +29,7 @@
String String::fromCFString (CFStringRef cfString) String String::fromCFString (CFStringRef cfString)
{ {
if (cfString == 0) if (cfString == 0)
return String::empty; return String();
CFRange range = { 0, CFStringGetLength (cfString) }; CFRange range = { 0, CFStringGetLength (cfString) };
HeapBlock <UniChar> u ((size_t) range.length + 1); HeapBlock <UniChar> u ((size_t) range.length + 1);

View file

@ -124,7 +124,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
return iOS; return iOS;
#else #else
StringArray parts; StringArray parts;
parts.addTokens (getOSXVersion(), ".", String::empty); parts.addTokens (getOSXVersion(), ".", String());
jassert (parts[0].getIntValue() == 10); jassert (parts[0].getIntValue() == 10);
const int major = parts[1].getIntValue(); const int major = parts[1].getIntValue();
@ -148,7 +148,7 @@ String SystemStats::getDeviceDescription()
#if JUCE_IOS #if JUCE_IOS
return nsStringToJuce ([[UIDevice currentDevice] model]); return nsStringToJuce ([[UIDevice currentDevice] model]);
#else #else
return String::empty; return String();
#endif #endif
} }
@ -182,7 +182,7 @@ String SystemStats::getCpuVendor()
return String (reinterpret_cast <const char*> (vendor), 12); return String (reinterpret_cast <const char*> (vendor), 12);
#else #else
return String::empty; return String();
#endif #endif
} }
@ -218,7 +218,7 @@ String SystemStats::getComputerName()
if (gethostname (name, sizeof (name) - 1) == 0) if (gethostname (name, sizeof (name) - 1) == 0)
return String (name).upToLastOccurrenceOf (".local", false, true); return String (name).upToLastOccurrenceOf (".local", false, true);
return String::empty; return String();
} }
static String getLocaleValue (CFStringRef key) static String getLocaleValue (CFStringRef key)

View file

@ -636,7 +636,7 @@ String File::getVolumeLabel() const
} }
#endif #endif
return String::empty; return String();
} }
int File::getVolumeSerialNumber() const int File::getVolumeSerialNumber() const

View file

@ -55,7 +55,7 @@ IPAddress::IPAddress (uint32 n) noexcept
IPAddress::IPAddress (const String& adr) IPAddress::IPAddress (const String& adr)
{ {
StringArray tokens; StringArray tokens;
tokens.addTokens (adr, ".", String::empty); tokens.addTokens (adr, ".", String());
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
address[i] = (uint8) tokens[i].getIntValue(); address[i] = (uint8) tokens[i].getIntValue();

View file

@ -146,7 +146,7 @@ public:
@see waitForNextConnection @see waitForNextConnection
*/ */
bool createListener (int portNumber, const String& localHostName = String::empty); bool createListener (int portNumber, const String& localHostName = String());
/** When in "listener" mode, this waits for a connection and spawns it as a new /** When in "listener" mode, this waits for a connection and spawns it as a new
socket. socket.

View file

@ -181,7 +181,7 @@ namespace URLHelpers
<< "\"; filename=\"" << file.getFileName() << "\"\r\n"; << "\"; filename=\"" << file.getFileName() << "\"\r\n";
const String mimeType (url.getMimeTypesOfUploadFiles() const String mimeType (url.getMimeTypesOfUploadFiles()
.getValue (paramName, String::empty)); .getValue (paramName, String()));
if (mimeType.isNotEmpty()) if (mimeType.isNotEmpty())
data << "Content-Type: " << mimeType << "\r\n"; data << "Content-Type: " << mimeType << "\r\n";
@ -253,7 +253,7 @@ String URL::getSubPath() const
{ {
const int startOfPath = URLHelpers::findStartOfPath (url); const int startOfPath = URLHelpers::findStartOfPath (url);
return startOfPath <= 0 ? String::empty return startOfPath <= 0 ? String()
: url.substring (startOfPath); : url.substring (startOfPath);
} }
@ -363,7 +363,7 @@ String URL::readEntireTextStream (const bool usePostCommand) const
if (in != nullptr) if (in != nullptr)
return in->readEntireStreamAsString(); return in->readEntireStreamAsString();
return String::empty; return String();
} }
XmlElement* URL::readEntireXmlStream (const bool usePostCommand) const XmlElement* URL::readEntireXmlStream (const bool usePostCommand) const
@ -470,5 +470,5 @@ bool URL::launchInDefaultBrowser() const
if (u.containsChar ('@') && ! u.containsChar (':')) if (u.containsChar ('@') && ! u.containsChar (':'))
u = "mailto:" + u; u = "mailto:" + u;
return Process::openDocument (u, String::empty); return Process::openDocument (u, String());
} }

View file

@ -251,7 +251,7 @@ public:
InputStream* createInputStream (bool usePostCommand, InputStream* createInputStream (bool usePostCommand,
OpenStreamProgressCallback* progressCallback = nullptr, OpenStreamProgressCallback* progressCallback = nullptr,
void* progressCallbackContext = nullptr, void* progressCallbackContext = nullptr,
String extraHeaders = String::empty, String extraHeaders = String(),
int connectionTimeOutMs = 0, int connectionTimeOutMs = 0,
StringPairArray* responseHeaders = nullptr) const; StringPairArray* responseHeaders = nullptr) const;

View file

@ -293,7 +293,7 @@ String StringArray::joinIntoString (StringRef separator, int start, int numberTo
start = 0; start = 0;
if (start >= last) if (start >= last)
return String::empty; return String();
if (start == last - 1) if (start == last - 1)
return strings.getReference (start); return strings.getReference (start);

View file

@ -81,7 +81,7 @@ namespace StringPoolHelpers
String::CharPointerType StringPool::getPooledString (const String& s) String::CharPointerType StringPool::getPooledString (const String& s)
{ {
if (s.isEmpty()) if (s.isEmpty())
return String::empty.getCharPointer(); return String().getCharPointer();
return StringPoolHelpers::getPooledStringFromArray (strings, s, lock); return StringPoolHelpers::getPooledStringFromArray (strings, s, lock);
} }
@ -89,7 +89,7 @@ String::CharPointerType StringPool::getPooledString (const String& s)
String::CharPointerType StringPool::getPooledString (const char* const s) String::CharPointerType StringPool::getPooledString (const char* const s)
{ {
if (s == nullptr || *s == 0) if (s == nullptr || *s == 0)
return String::empty.getCharPointer(); return String().getCharPointer();
return StringPoolHelpers::getPooledStringFromArray (strings, s, lock); return StringPoolHelpers::getPooledStringFromArray (strings, s, lock);
} }
@ -97,7 +97,7 @@ String::CharPointerType StringPool::getPooledString (const char* const s)
String::CharPointerType StringPool::getPooledString (const wchar_t* const s) String::CharPointerType StringPool::getPooledString (const wchar_t* const s)
{ {
if (s == nullptr || *s == 0) if (s == nullptr || *s == 0)
return String::empty.getCharPointer(); return String().getCharPointer();
return StringPoolHelpers::getPooledStringFromArray (strings, s, lock); return StringPoolHelpers::getPooledStringFromArray (strings, s, lock);
} }

View file

@ -195,7 +195,7 @@ bool PropertiesFile::loadAsXml()
{ {
getAllProperties().set (name, getAllProperties().set (name,
e->getFirstChildElement() != nullptr e->getFirstChildElement() != nullptr
? e->getFirstChildElement()->createDocument (String::empty, true) ? e->getFirstChildElement()->createDocument ("", true)
: e->getStringAttribute (PropertyFileConstants::valueAttribute)); : e->getStringAttribute (PropertyFileConstants::valueAttribute));
} }
} }
@ -234,7 +234,7 @@ bool PropertiesFile::saveAsXml()
if (pl != nullptr && ! pl->isLocked()) if (pl != nullptr && ! pl->isLocked())
return false; // locking failure.. return false; // locking failure..
if (doc.writeToFile (file, String::empty)) if (doc.writeToFile (file, String()))
{ {
needsWriting = false; needsWriting = false;
return true; return true;

View file

@ -235,7 +235,7 @@ String UndoManager::getUndoDescription() const
if (const ActionSet* const s = getCurrentSet()) if (const ActionSet* const s = getCurrentSet())
return s->name; return s->name;
return String::empty; return String();
} }
String UndoManager::getRedoDescription() const String UndoManager::getRedoDescription() const
@ -243,7 +243,7 @@ String UndoManager::getRedoDescription() const
if (const ActionSet* const s = getNextSet()) if (const ActionSet* const s = getNextSet())
return s->name; return s->name;
return String::empty; return String();
} }
Time UndoManager::getTimeOfUndoTransaction() const Time UndoManager::getTimeOfUndoTransaction() const

View file

@ -107,7 +107,7 @@ public:
@see beginNewTransaction @see beginNewTransaction
*/ */
bool perform (UndoableAction* action, bool perform (UndoableAction* action,
const String& actionName = String::empty); const String& actionName = String());
/** Starts a new group of actions that together will be treated as a single transaction. /** Starts a new group of actions that together will be treated as a single transaction.
@ -118,7 +118,7 @@ public:
@param actionName a description of the transaction that is about to be @param actionName a description of the transaction that is about to be
performed performed
*/ */
void beginNewTransaction (const String& actionName = String::empty); void beginNewTransaction (const String& actionName = String());
/** Changes the name stored for the current transaction. /** Changes the name stored for the current transaction.

View file

@ -444,7 +444,7 @@ public:
} }
else else
{ {
output.writeString (String::empty); output.writeString (String());
output.writeCompressedInt (0); output.writeCompressedInt (0);
output.writeCompressedInt (0); output.writeCompressedInt (0);
} }
@ -962,7 +962,7 @@ ValueTree ValueTree::fromXml (const XmlElement& xml)
String ValueTree::toXmlString() const String ValueTree::toXmlString() const
{ {
const ScopedPointer<XmlElement> xml (createXml()); const ScopedPointer<XmlElement> xml (createXml());
return xml != nullptr ? xml->createDocument (String::empty) : String::empty; return xml != nullptr ? xml->createDocument ("") : String();
} }
//============================================================================== //==============================================================================

View file

@ -141,7 +141,7 @@ String InterprocessConnection::getConnectedHostName() const
return "localhost"; return "localhost";
} }
return String::empty; return String();
} }
//============================================================================== //==============================================================================

View file

@ -134,7 +134,7 @@ struct JUCEApplicationBase::MultipleInstanceHandler {};
#if JUCE_ANDROID #if JUCE_ANDROID
StringArray JUCEApplicationBase::getCommandLineParameterArray() { return StringArray(); } StringArray JUCEApplicationBase::getCommandLineParameterArray() { return StringArray(); }
String JUCEApplicationBase::getCommandLineParameters() { return String::empty; } String JUCEApplicationBase::getCommandLineParameters() { return String(); }
#else #else

View file

@ -99,13 +99,13 @@ namespace CustomTypefaceHelpers
//============================================================================== //==============================================================================
CustomTypeface::CustomTypeface() CustomTypeface::CustomTypeface()
: Typeface (String::empty, String::empty) : Typeface (String(), String())
{ {
clear(); clear();
} }
CustomTypeface::CustomTypeface (InputStream& serialisedTypefaceStream) CustomTypeface::CustomTypeface (InputStream& serialisedTypefaceStream)
: Typeface (String::empty, String::empty) : Typeface (String(), String())
{ {
clear(); clear();

View file

@ -865,7 +865,7 @@ public:
static Rectangle fromString (StringRef stringVersion) static Rectangle fromString (StringRef stringVersion)
{ {
StringArray toks; StringArray toks;
toks.addTokens (stringVersion.text.findEndOfWhitespace(), ",; \t\r\n", String::empty); toks.addTokens (stringVersion.text.findEndOfWhitespace(), ",; \t\r\n", "");
return Rectangle (parseIntAfterSpace (toks[0]), return Rectangle (parseIntAfterSpace (toks[0]),
parseIntAfterSpace (toks[1]), parseIntAfterSpace (toks[1]),

View file

@ -291,7 +291,7 @@ private:
file = getFontFile (family, "Regular"); file = getFontFile (family, "Regular");
if (! file.exists()) if (! file.exists())
file = getFontFile (family, String::empty); file = getFontFile (family, String());
return file; return file;
} }

View file

@ -111,7 +111,7 @@ public:
const KnownTypeface* ftFace = matchTypeface (fontName, fontStyle); const KnownTypeface* ftFace = matchTypeface (fontName, fontStyle);
if (ftFace == nullptr) ftFace = matchTypeface (fontName, "Regular"); if (ftFace == nullptr) ftFace = matchTypeface (fontName, "Regular");
if (ftFace == nullptr) ftFace = matchTypeface (fontName, String::empty); if (ftFace == nullptr) ftFace = matchTypeface (fontName, String());
if (ftFace != nullptr) if (ftFace != nullptr)
{ {

View file

@ -43,7 +43,7 @@ StringArray FTTypefaceList::getDefaultFontDirectories()
{ {
if (e->getStringAttribute ("prefix") == "xdg") if (e->getStringAttribute ("prefix") == "xdg")
{ {
String xdgDataHome (SystemStats::getEnvironmentVariable ("XDG_DATA_HOME", String::empty)); String xdgDataHome (SystemStats::getEnvironmentVariable ("XDG_DATA_HOME", String()));
if (xdgDataHome.trimStart().isEmpty()) if (xdgDataHome.trimStart().isEmpty())
xdgDataHome = "~/.local/share"; xdgDataHome = "~/.local/share";

View file

@ -127,7 +127,7 @@ String ApplicationCommandManager::getNameOfCommand (const CommandID commandID) c
if (const ApplicationCommandInfo* const ci = getCommandForID (commandID)) if (const ApplicationCommandInfo* const ci = getCommandForID (commandID))
return ci->shortName; return ci->shortName;
return String::empty; return String();
} }
String ApplicationCommandManager::getDescriptionOfCommand (const CommandID commandID) const noexcept String ApplicationCommandManager::getDescriptionOfCommand (const CommandID commandID) const noexcept
@ -136,7 +136,7 @@ String ApplicationCommandManager::getDescriptionOfCommand (const CommandID comma
return ci->description.isNotEmpty() ? ci->description return ci->description.isNotEmpty() ? ci->description
: ci->shortName; : ci->shortName;
return String::empty; return String();
} }
StringArray ApplicationCommandManager::getCommandCategories() const StringArray ApplicationCommandManager::getCommandCategories() const

View file

@ -944,7 +944,7 @@ private:
} }
String getStyleAttribute (const XmlPath& xml, const String& attributeName, String getStyleAttribute (const XmlPath& xml, const String& attributeName,
const String& defaultValue = String::empty) const const String& defaultValue = String()) const
{ {
if (xml->hasAttribute (attributeName)) if (xml->hasAttribute (attributeName))
return xml->getStringAttribute (attributeName, defaultValue); return xml->getStringAttribute (attributeName, defaultValue);
@ -953,7 +953,7 @@ private:
if (styleAtt.isNotEmpty()) if (styleAtt.isNotEmpty())
{ {
const String value (getAttributeFromStyleList (styleAtt, attributeName, String::empty)); const String value (getAttributeFromStyleList (styleAtt, attributeName, String()));
if (value.isNotEmpty()) if (value.isNotEmpty())
return value; return value;
@ -991,7 +991,7 @@ private:
if (xml.parent != nullptr) if (xml.parent != nullptr)
return getInheritedAttribute (*xml.parent, attributeName); return getInheritedAttribute (*xml.parent, attributeName);
return String::empty; return String();
} }
//============================================================================== //==============================================================================
@ -1144,7 +1144,7 @@ private:
StringArray tokens; StringArray tokens;
tokens.addTokens (t.fromFirstOccurrenceOf ("(", false, false) tokens.addTokens (t.fromFirstOccurrenceOf ("(", false, false)
.upToFirstOccurrenceOf (")", false, false), .upToFirstOccurrenceOf (")", false, false),
", ", String::empty); ", ", "");
tokens.removeEmptyStrings (true); tokens.removeEmptyStrings (true);

View file

@ -439,7 +439,7 @@ String SystemClipboard::getTextFromClipboard()
{ {
NSString* text = [[NSPasteboard generalPasteboard] stringForType: NSStringPboardType]; NSString* text = [[NSPasteboard generalPasteboard] stringForType: NSStringPboardType];
return text == nil ? String::empty return text == nil ? String()
: nsStringToJuce (text); : nsStringToJuce (text);
} }

View file

@ -440,7 +440,7 @@ String TableHeaderComponent::toString() const
e->setAttribute ("width", ci->width); e->setAttribute ("width", ci->width);
} }
return doc.createDocument (String::empty, true, false); return doc.createDocument ("", true, false);
} }
void TableHeaderComponent::restoreFromString (const String& storedVersion) void TableHeaderComponent::restoreFromString (const String& storedVersion)