From 2edec00b555eef661f2c2319f8eee461b3af2cdd Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 1 Dec 2013 23:28:31 +0000 Subject: [PATCH] Removed a few more uses of String::empty. --- .../Source/ComponentEditor/jucer_ComponentLayout.cpp | 2 +- .../Source/ComponentEditor/jucer_JucerDocument.cpp | 2 +- .../Source/ComponentEditor/jucer_PaintRoutine.cpp | 2 +- .../audio_io/juce_AudioDeviceManager.cpp | 8 ++++---- .../native/juce_android_OpenSL.cpp | 2 +- .../codecs/juce_AiffAudioFormat.cpp | 2 +- .../codecs/juce_LAMEEncoderAudioFormat.cpp | 2 +- .../format_types/juce_AudioUnitPluginFormat.mm | 8 ++++---- .../format_types/juce_LADSPAPluginFormat.cpp | 12 ++++++------ .../processors/juce_AudioProcessor.cpp | 4 ++-- .../processors/juce_AudioProcessorGraph.cpp | 12 ++++++------ .../processors/juce_AudioProcessorGraph.h | 6 +++--- modules/juce_core/containers/juce_PropertySet.cpp | 2 +- modules/juce_core/containers/juce_PropertySet.h | 2 +- modules/juce_core/files/juce_File.cpp | 8 ++++---- modules/juce_core/files/juce_TemporaryFile.h | 2 +- modules/juce_core/maths/juce_BigInteger.cpp | 2 +- modules/juce_core/maths/juce_Expression.cpp | 4 ++-- modules/juce_core/native/juce_linux_Files.cpp | 2 +- modules/juce_core/native/juce_linux_Network.cpp | 6 +++--- modules/juce_core/native/juce_linux_SystemStats.cpp | 8 ++++---- modules/juce_core/native/juce_mac_Files.mm | 2 +- modules/juce_core/native/juce_mac_Strings.mm | 2 +- modules/juce_core/native/juce_mac_SystemStats.mm | 8 ++++---- modules/juce_core/native/juce_posix_SharedCode.h | 2 +- modules/juce_core/network/juce_IPAddress.cpp | 2 +- modules/juce_core/network/juce_Socket.h | 2 +- modules/juce_core/network/juce_URL.cpp | 8 ++++---- modules/juce_core/network/juce_URL.h | 2 +- modules/juce_core/text/juce_StringArray.cpp | 2 +- modules/juce_core/text/juce_StringPool.cpp | 6 +++--- .../app_properties/juce_PropertiesFile.cpp | 4 ++-- .../undomanager/juce_UndoManager.cpp | 4 ++-- .../undomanager/juce_UndoManager.h | 4 ++-- .../juce_data_structures/values/juce_ValueTree.cpp | 4 ++-- .../interprocess/juce_InterprocessConnection.cpp | 2 +- .../juce_events/messages/juce_ApplicationBase.cpp | 2 +- modules/juce_graphics/fonts/juce_CustomTypeface.cpp | 4 ++-- modules/juce_graphics/geometry/juce_Rectangle.h | 2 +- modules/juce_graphics/native/juce_android_Fonts.cpp | 2 +- modules/juce_graphics/native/juce_freetype_Fonts.cpp | 2 +- modules/juce_graphics/native/juce_linux_Fonts.cpp | 2 +- .../commands/juce_ApplicationCommandManager.cpp | 4 ++-- modules/juce_gui_basics/drawables/juce_SVGParser.cpp | 8 ++++---- modules/juce_gui_basics/native/juce_mac_Windowing.mm | 2 +- .../widgets/juce_TableHeaderComponent.cpp | 2 +- 46 files changed, 91 insertions(+), 91 deletions(-) diff --git a/extras/Introjucer/Source/ComponentEditor/jucer_ComponentLayout.cpp b/extras/Introjucer/Source/ComponentEditor/jucer_ComponentLayout.cpp index 3cd1ff0ff6..f7e7652a7c 100644 --- a/extras/Introjucer/Source/ComponentEditor/jucer_ComponentLayout.cpp +++ b/extras/Introjucer/Source/ComponentEditor/jucer_ComponentLayout.cpp @@ -265,7 +265,7 @@ void ComponentLayout::copySelectedToClipboard() } } - SystemClipboard::copyTextToClipboard (clip.createDocument (String::empty, false, false)); + SystemClipboard::copyTextToClipboard (clip.createDocument ("", false, false)); } void ComponentLayout::paste() diff --git a/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp b/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp index 24b2fd4c98..d491754d49 100644 --- a/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp +++ b/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp @@ -441,7 +441,7 @@ void JucerDocument::fillInGeneratedCode (GeneratedCode& code) const ScopedPointer e (createXml()); jassert (e != nullptr); - code.jucerMetadata = e->createDocument (String::empty, false, false); + code.jucerMetadata = e->createDocument ("", false, false); resources.fillInGeneratedCode (code); diff --git a/extras/Introjucer/Source/ComponentEditor/jucer_PaintRoutine.cpp b/extras/Introjucer/Source/ComponentEditor/jucer_PaintRoutine.cpp index b3c9ae2ea9..73621112cb 100644 --- a/extras/Introjucer/Source/ComponentEditor/jucer_PaintRoutine.cpp +++ b/extras/Introjucer/Source/ComponentEditor/jucer_PaintRoutine.cpp @@ -304,7 +304,7 @@ void PaintRoutine::copySelectedToClipboard() } } - SystemClipboard::copyTextToClipboard (clip.createDocument (String::empty, false, false)); + SystemClipboard::copyTextToClipboard (clip.createDocument ("", false, false)); } void PaintRoutine::paste() diff --git a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp index b04c95c469..6a535e1bdd 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp +++ b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp @@ -408,15 +408,15 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup jassert (&newSetup != ¤tSetup); // this will have no effect if (newSetup == currentSetup && currentAudioDevice != nullptr) - return String::empty; + return String(); if (! (newSetup == currentSetup)) sendChangeMessage(); stopDevice(); - const String newInputDeviceName (numInputChansNeeded == 0 ? String::empty : newSetup.inputDeviceName); - const String newOutputDeviceName (numOutputChansNeeded == 0 ? String::empty : newSetup.outputDeviceName); + const String newInputDeviceName (numInputChansNeeded == 0 ? String() : newSetup.inputDeviceName); + const String newOutputDeviceName (numOutputChansNeeded == 0 ? String() : newSetup.outputDeviceName); String error; AudioIODeviceType* type = getCurrentDeviceTypeObject(); @@ -428,7 +428,7 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup if (treatAsChosenDevice) updateXml(); - return String::empty; + return String(); } if (currentSetup.inputDeviceName != newInputDeviceName diff --git a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp index ad29411913..67ad839c96 100644 --- a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp +++ b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp @@ -46,7 +46,7 @@ public: { // 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.. - AndroidAudioIODevice javaDevice (String::empty); + AndroidAudioIODevice javaDevice (String()); // this is a total guess about how to calculate the latency, but seems to vaguely agree // with the devices I've tested.. YMMV diff --git a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp index 86f99760e7..d7edd45dc7 100644 --- a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp @@ -343,7 +343,7 @@ namespace AiffFileHelpers out.writeIntBigEndian (values.getValue (prefix + "TimeStamp", "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); out.writeShortBigEndian ((short) commentLength + 1); diff --git a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp index c5c337f2b5..36ba625d7e 100644 --- a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp @@ -72,7 +72,7 @@ public: 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()) { diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index b6f849f7e8..dc2a2d51df 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -136,7 +136,7 @@ namespace AudioUnitFormatHelpers fileOrIdentifier.lastIndexOfChar ('/')) + 1)); StringArray tokens; - tokens.addTokens (s, ",", String::empty); + tokens.addTokens (s, ",", String()); tokens.removeEmptyStrings(); if (tokens.size() == 3) @@ -570,7 +570,7 @@ public: if (isPositiveAndBelow (index, getNumInputChannels())) return "Input " + String (index + 1); - return String::empty; + return String(); } const String getOutputChannelName (int index) const override @@ -578,7 +578,7 @@ public: if (isPositiveAndBelow (index, getNumOutputChannels())) return "Output " + String (index + 1); - return String::empty; + return String(); } bool isInputChannelStereoPair (int index) const override { return isPositiveAndBelow (index, getNumInputChannels()); } @@ -652,7 +652,7 @@ public: if (const ParamInfo* p = parameters[index]) return p->name; - return String::empty; + return String(); } const String getParameterText (int index) override { return String (getParameter (index)); } diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp index c7f794b2a3..d528a271d7 100644 --- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp @@ -222,7 +222,7 @@ public: desc.lastFileModTime = module->file.getLastModificationTime(); desc.pluginFormatName = "LADSPA"; desc.category = getCategory(); - desc.manufacturerName = plugin != nullptr ? String (plugin->Maker) : String::empty; + desc.manufacturerName = plugin != nullptr ? String (plugin->Maker) : String(); desc.version = getVersion(); desc.numInputChannels = getNumInputChannels(); desc.numOutputChannels = getNumOutputChannels(); @@ -338,7 +338,7 @@ public: if (isPositiveAndBelow (index, getNumInputChannels())) return String (plugin->PortNames [inputs [index]]).trim(); - return String::empty; + return String(); } const String getOutputChannelName (const int index) const @@ -346,7 +346,7 @@ public: if (isPositiveAndBelow (index, getNumInputChannels())) 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::empty; + return String(); } const String getParameterText (int index) @@ -407,7 +407,7 @@ public: return String (parameterValues[index].scaled, 4); } - return String::empty; + return String(); } //============================================================================== @@ -424,7 +424,7 @@ public: const String getProgramName (int index) { // XXX - return String::empty; + return String(); } void changeProgramName (int index, const String& newName) diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp index 8f4f43ab6d..501fedf43d 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp @@ -201,7 +201,7 @@ void AudioProcessor::updateHostDisplay() 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::isMetaParameter (int) const { return false; } @@ -266,7 +266,7 @@ void AudioProcessor::copyXmlToBinary (const XmlElement& xml, juce::MemoryBlock& MemoryOutputStream out (destData, false); out.writeInt (magicXmlNumber); out.writeInt (0); - xml.writeToStream (out, String::empty, true, false); + xml.writeToStream (out, String(), true, false); out.writeByte (0); } diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp index e965b22254..c1f192902a 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp @@ -1367,7 +1367,7 @@ const String AudioProcessorGraph::AudioGraphIOProcessor::getName() const default: break; } - return String::empty; + return String(); } void AudioProcessorGraph::AudioGraphIOProcessor::fillInPluginDescription (PluginDescription& d) const @@ -1469,7 +1469,7 @@ const String AudioProcessorGraph::AudioGraphIOProcessor::getInputChannelName (in default: break; } - return String::empty; + return String(); } const String AudioProcessorGraph::AudioGraphIOProcessor::getOutputChannelName (int channelIndex) const @@ -1481,7 +1481,7 @@ const String AudioProcessorGraph::AudioGraphIOProcessor::getOutputChannelName (i default: break; } - return String::empty; + return String(); } bool AudioProcessorGraph::AudioGraphIOProcessor::isInputChannelStereoPair (int /*index*/) const @@ -1501,17 +1501,17 @@ bool AudioProcessorGraph::AudioGraphIOProcessor::hasEditor() const AudioProcessorEditor* AudioProcessorGraph::AudioGraphIOProcessor::createEditor() { return nullptr; } 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; } -const String AudioProcessorGraph::AudioGraphIOProcessor::getParameterText (int) { return String::empty; } +const String AudioProcessorGraph::AudioGraphIOProcessor::getParameterText (int) { return String(); } void AudioProcessorGraph::AudioGraphIOProcessor::setParameter (int, float) { } int AudioProcessorGraph::AudioGraphIOProcessor::getNumPrograms() { return 0; } int AudioProcessorGraph::AudioGraphIOProcessor::getCurrentProgram() { return 0; } 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::getStateInformation (juce::MemoryBlock&) {} diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h index bf2267078f..7deb9b5981 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h @@ -372,15 +372,15 @@ public: AudioProcessorEditor* createEditor() { return nullptr; } int getNumParameters() { return 0; } - const String getParameterName (int) { return String::empty; } + const String getParameterName (int) { return String(); } float getParameter (int) { return 0; } - const String getParameterText (int) { return String::empty; } + const String getParameterText (int) { return String(); } void setParameter (int, float) { } int getNumPrograms() { return 0; } int getCurrentProgram() { return 0; } void setCurrentProgram (int) { } - const String getProgramName (int) { return String::empty; } + const String getProgramName (int) { return String(); } void changeProgramName (int, const String&) { } void getStateInformation (juce::MemoryBlock&); diff --git a/modules/juce_core/containers/juce_PropertySet.cpp b/modules/juce_core/containers/juce_PropertySet.cpp index 735dc60f09..d3c05bc723 100644 --- a/modules/juce_core/containers/juce_PropertySet.cpp +++ b/modules/juce_core/containers/juce_PropertySet.cpp @@ -156,7 +156,7 @@ void PropertySet::removeValue (StringRef keyName) void PropertySet::setValue (const String& keyName, const XmlElement* const xml) { setValue (keyName, xml == nullptr ? var::null - : var (xml->createDocument (String::empty, true))); + : var (xml->createDocument ("", true))); } bool PropertySet::containsKey (StringRef keyName) const noexcept diff --git a/modules/juce_core/containers/juce_PropertySet.h b/modules/juce_core/containers/juce_PropertySet.h index 3018b886ca..2a4ecb1216 100644 --- a/modules/juce_core/containers/juce_PropertySet.h +++ b/modules/juce_core/containers/juce_PropertySet.h @@ -69,7 +69,7 @@ public: @param keyName the name of the property to retrieve @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. diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index b69b5a7962..ea945999ea 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -75,7 +75,7 @@ const File File::nonexistent; String File::parseAbsolutePath (const String& p) { if (p.isEmpty()) - return String::empty; + return String(); #if JUCE_WINDOWS // Windows.. @@ -482,11 +482,11 @@ bool File::loadFileAsData (MemoryBlock& destBlock) const String File::loadFileAsString() const { if (! existsAsFile()) - return String::empty; + return String(); FileInputStream in (*this); return in.openedOk() ? in.readEntireStreamAsString() - : String::empty; + : String(); } void File::readLines (StringArray& destLines) const @@ -598,7 +598,7 @@ String File::getFileExtension() const if (indexOfDot > fullPath.lastIndexOfChar (separator)) return fullPath.substring (indexOfDot); - return String::empty; + return String(); } bool File::hasFileExtension (StringRef possibleSuffix) const diff --git a/modules/juce_core/files/juce_TemporaryFile.h b/modules/juce_core/files/juce_TemporaryFile.h index ef489039c2..04561a74b1 100644 --- a/modules/juce_core/files/juce_TemporaryFile.h +++ b/modules/juce_core/files/juce_TemporaryFile.h @@ -89,7 +89,7 @@ public: 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! */ - TemporaryFile (const String& suffix = String::empty, + TemporaryFile (const String& suffix = String(), int optionFlags = 0); /** Creates a temporary file in the same directory as a specified file. diff --git a/modules/juce_core/maths/juce_BigInteger.cpp b/modules/juce_core/maths/juce_BigInteger.cpp index ba37420fc3..ba194145c4 100644 --- a/modules/juce_core/maths/juce_BigInteger.cpp +++ b/modules/juce_core/maths/juce_BigInteger.cpp @@ -951,7 +951,7 @@ String BigInteger::toString (const int base, const int minimumNumCharacters) con else { jassertfalse; // can't do the specified base! - return String::empty; + return String(); } s = s.paddedLeft ('0', minimumNumCharacters); diff --git a/modules/juce_core/maths/juce_Expression.cpp b/modules/juce_core/maths/juce_Expression.cpp index 41b144a8cb..9734446796 100644 --- a/modules/juce_core/maths/juce_Expression.cpp +++ b/modules/juce_core/maths/juce_Expression.cpp @@ -53,7 +53,7 @@ public: virtual String getName() const { 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) @@ -1181,5 +1181,5 @@ void Expression::Scope::visitRelativeScope (const String& scopeName, Visitor&) c String Expression::Scope::getScopeUID() const { - return String::empty; + return String(); } diff --git a/modules/juce_core/native/juce_linux_Files.cpp b/modules/juce_core/native/juce_linux_Files.cpp index 436480deb1..45318d33df 100644 --- a/modules/juce_core/native/juce_linux_Files.cpp +++ b/modules/juce_core/native/juce_linux_Files.cpp @@ -72,7 +72,7 @@ bool File::isOnRemovableDrive() const String File::getVersion() const { - return String::empty; // xxx not yet implemented + return String(); // xxx not yet implemented } //============================================================================== diff --git a/modules/juce_core/native/juce_linux_Network.cpp b/modules/juce_core/native/juce_linux_Network.cpp index a946273f4e..a052b2c216 100644 --- a/modules/juce_core/native/juce_linux_Network.cpp +++ b/modules/juce_core/native/juce_linux_Network.cpp @@ -309,7 +309,7 @@ private: { char c = 0; if (read (&c, 1) != 1) - return String::empty; + return String(); buffer.writeByte (c); @@ -324,7 +324,7 @@ private: if (header.startsWithIgnoreCase ("HTTP/")) return header; - return String::empty; + return String(); } static void writeValueIfNotPresent (MemoryOutputStream& dest, const String& headers, const String& key, const String& value) @@ -432,7 +432,7 @@ private: if (lines[i].startsWithIgnoreCase (itemName)) return lines[i].substring (itemName.length()).trim(); - return String::empty; + return String(); } JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream) diff --git a/modules/juce_core/native/juce_linux_SystemStats.cpp b/modules/juce_core/native/juce_linux_SystemStats.cpp index 91cecbdcb2..a2575a13a9 100644 --- a/modules/juce_core/native/juce_linux_SystemStats.cpp +++ b/modules/juce_core/native/juce_linux_SystemStats.cpp @@ -44,7 +44,7 @@ String SystemStats::getOperatingSystemName() String SystemStats::getDeviceDescription() { - return String::empty; + return String(); } bool SystemStats::isOperatingSystem64Bit() @@ -69,7 +69,7 @@ namespace LinuxStatsHelpers if (lines[i].startsWithIgnoreCase (key)) 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())) return CharPointer_UTF8 (pw->pw_name); - return String::empty; + return String(); } String SystemStats::getFullUserName() @@ -121,7 +121,7 @@ String SystemStats::getComputerName() if (gethostname (name, sizeof (name) - 1) == 0) return name; - return String::empty; + return String(); } static String getLocaleValue (nl_item key) diff --git a/modules/juce_core/native/juce_mac_Files.mm b/modules/juce_core/native/juce_mac_Files.mm index e4d4f9668e..ab93b83ee5 100644 --- a/modules/juce_core/native/juce_mac_Files.mm +++ b/modules/juce_core/native/juce_mac_Files.mm @@ -271,7 +271,7 @@ String File::getVersion() const return nsStringToJuce (name); } - return String::empty; + return String(); } //============================================================================== diff --git a/modules/juce_core/native/juce_mac_Strings.mm b/modules/juce_core/native/juce_mac_Strings.mm index ac81900524..862eb539e8 100644 --- a/modules/juce_core/native/juce_mac_Strings.mm +++ b/modules/juce_core/native/juce_mac_Strings.mm @@ -29,7 +29,7 @@ String String::fromCFString (CFStringRef cfString) { if (cfString == 0) - return String::empty; + return String(); CFRange range = { 0, CFStringGetLength (cfString) }; HeapBlock u ((size_t) range.length + 1); diff --git a/modules/juce_core/native/juce_mac_SystemStats.mm b/modules/juce_core/native/juce_mac_SystemStats.mm index ecccb2daa9..45967ee510 100644 --- a/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/modules/juce_core/native/juce_mac_SystemStats.mm @@ -124,7 +124,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() return iOS; #else StringArray parts; - parts.addTokens (getOSXVersion(), ".", String::empty); + parts.addTokens (getOSXVersion(), ".", String()); jassert (parts[0].getIntValue() == 10); const int major = parts[1].getIntValue(); @@ -148,7 +148,7 @@ String SystemStats::getDeviceDescription() #if JUCE_IOS return nsStringToJuce ([[UIDevice currentDevice] model]); #else - return String::empty; + return String(); #endif } @@ -182,7 +182,7 @@ String SystemStats::getCpuVendor() return String (reinterpret_cast (vendor), 12); #else - return String::empty; + return String(); #endif } @@ -218,7 +218,7 @@ String SystemStats::getComputerName() if (gethostname (name, sizeof (name) - 1) == 0) return String (name).upToLastOccurrenceOf (".local", false, true); - return String::empty; + return String(); } static String getLocaleValue (CFStringRef key) diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index 243a1943a0..46d2382d68 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -636,7 +636,7 @@ String File::getVolumeLabel() const } #endif - return String::empty; + return String(); } int File::getVolumeSerialNumber() const diff --git a/modules/juce_core/network/juce_IPAddress.cpp b/modules/juce_core/network/juce_IPAddress.cpp index ced207d989..6c4d087712 100644 --- a/modules/juce_core/network/juce_IPAddress.cpp +++ b/modules/juce_core/network/juce_IPAddress.cpp @@ -55,7 +55,7 @@ IPAddress::IPAddress (uint32 n) noexcept IPAddress::IPAddress (const String& adr) { StringArray tokens; - tokens.addTokens (adr, ".", String::empty); + tokens.addTokens (adr, ".", String()); for (int i = 0; i < 4; ++i) address[i] = (uint8) tokens[i].getIntValue(); diff --git a/modules/juce_core/network/juce_Socket.h b/modules/juce_core/network/juce_Socket.h index 616d2db095..73795c9563 100644 --- a/modules/juce_core/network/juce_Socket.h +++ b/modules/juce_core/network/juce_Socket.h @@ -146,7 +146,7 @@ public: @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 socket. diff --git a/modules/juce_core/network/juce_URL.cpp b/modules/juce_core/network/juce_URL.cpp index b9db52adb4..cf9f2cf67a 100644 --- a/modules/juce_core/network/juce_URL.cpp +++ b/modules/juce_core/network/juce_URL.cpp @@ -181,7 +181,7 @@ namespace URLHelpers << "\"; filename=\"" << file.getFileName() << "\"\r\n"; const String mimeType (url.getMimeTypesOfUploadFiles() - .getValue (paramName, String::empty)); + .getValue (paramName, String())); if (mimeType.isNotEmpty()) data << "Content-Type: " << mimeType << "\r\n"; @@ -253,7 +253,7 @@ String URL::getSubPath() const { const int startOfPath = URLHelpers::findStartOfPath (url); - return startOfPath <= 0 ? String::empty + return startOfPath <= 0 ? String() : url.substring (startOfPath); } @@ -363,7 +363,7 @@ String URL::readEntireTextStream (const bool usePostCommand) const if (in != nullptr) return in->readEntireStreamAsString(); - return String::empty; + return String(); } XmlElement* URL::readEntireXmlStream (const bool usePostCommand) const @@ -470,5 +470,5 @@ bool URL::launchInDefaultBrowser() const if (u.containsChar ('@') && ! u.containsChar (':')) u = "mailto:" + u; - return Process::openDocument (u, String::empty); + return Process::openDocument (u, String()); } diff --git a/modules/juce_core/network/juce_URL.h b/modules/juce_core/network/juce_URL.h index 462ec88d99..28d3aac618 100644 --- a/modules/juce_core/network/juce_URL.h +++ b/modules/juce_core/network/juce_URL.h @@ -251,7 +251,7 @@ public: InputStream* createInputStream (bool usePostCommand, OpenStreamProgressCallback* progressCallback = nullptr, void* progressCallbackContext = nullptr, - String extraHeaders = String::empty, + String extraHeaders = String(), int connectionTimeOutMs = 0, StringPairArray* responseHeaders = nullptr) const; diff --git a/modules/juce_core/text/juce_StringArray.cpp b/modules/juce_core/text/juce_StringArray.cpp index 4925023d08..e26d38d118 100644 --- a/modules/juce_core/text/juce_StringArray.cpp +++ b/modules/juce_core/text/juce_StringArray.cpp @@ -293,7 +293,7 @@ String StringArray::joinIntoString (StringRef separator, int start, int numberTo start = 0; if (start >= last) - return String::empty; + return String(); if (start == last - 1) return strings.getReference (start); diff --git a/modules/juce_core/text/juce_StringPool.cpp b/modules/juce_core/text/juce_StringPool.cpp index 88ea9a0ffb..6841c47d88 100644 --- a/modules/juce_core/text/juce_StringPool.cpp +++ b/modules/juce_core/text/juce_StringPool.cpp @@ -81,7 +81,7 @@ namespace StringPoolHelpers String::CharPointerType StringPool::getPooledString (const String& s) { if (s.isEmpty()) - return String::empty.getCharPointer(); + return String().getCharPointer(); 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) { if (s == nullptr || *s == 0) - return String::empty.getCharPointer(); + return String().getCharPointer(); 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) { if (s == nullptr || *s == 0) - return String::empty.getCharPointer(); + return String().getCharPointer(); return StringPoolHelpers::getPooledStringFromArray (strings, s, lock); } diff --git a/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp b/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp index 78c97366a1..0d83730f7f 100644 --- a/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp +++ b/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp @@ -195,7 +195,7 @@ bool PropertiesFile::loadAsXml() { getAllProperties().set (name, e->getFirstChildElement() != nullptr - ? e->getFirstChildElement()->createDocument (String::empty, true) + ? e->getFirstChildElement()->createDocument ("", true) : e->getStringAttribute (PropertyFileConstants::valueAttribute)); } } @@ -234,7 +234,7 @@ bool PropertiesFile::saveAsXml() if (pl != nullptr && ! pl->isLocked()) return false; // locking failure.. - if (doc.writeToFile (file, String::empty)) + if (doc.writeToFile (file, String())) { needsWriting = false; return true; diff --git a/modules/juce_data_structures/undomanager/juce_UndoManager.cpp b/modules/juce_data_structures/undomanager/juce_UndoManager.cpp index 328a052336..3557b90d86 100644 --- a/modules/juce_data_structures/undomanager/juce_UndoManager.cpp +++ b/modules/juce_data_structures/undomanager/juce_UndoManager.cpp @@ -235,7 +235,7 @@ String UndoManager::getUndoDescription() const if (const ActionSet* const s = getCurrentSet()) return s->name; - return String::empty; + return String(); } String UndoManager::getRedoDescription() const @@ -243,7 +243,7 @@ String UndoManager::getRedoDescription() const if (const ActionSet* const s = getNextSet()) return s->name; - return String::empty; + return String(); } Time UndoManager::getTimeOfUndoTransaction() const diff --git a/modules/juce_data_structures/undomanager/juce_UndoManager.h b/modules/juce_data_structures/undomanager/juce_UndoManager.h index 6948263ef3..eee9cbcfa7 100644 --- a/modules/juce_data_structures/undomanager/juce_UndoManager.h +++ b/modules/juce_data_structures/undomanager/juce_UndoManager.h @@ -107,7 +107,7 @@ public: @see beginNewTransaction */ 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. @@ -118,7 +118,7 @@ public: @param actionName a description of the transaction that is about to be performed */ - void beginNewTransaction (const String& actionName = String::empty); + void beginNewTransaction (const String& actionName = String()); /** Changes the name stored for the current transaction. diff --git a/modules/juce_data_structures/values/juce_ValueTree.cpp b/modules/juce_data_structures/values/juce_ValueTree.cpp index 2c4a94cef4..7acbcefe0b 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.cpp +++ b/modules/juce_data_structures/values/juce_ValueTree.cpp @@ -444,7 +444,7 @@ public: } else { - output.writeString (String::empty); + output.writeString (String()); output.writeCompressedInt (0); output.writeCompressedInt (0); } @@ -962,7 +962,7 @@ ValueTree ValueTree::fromXml (const XmlElement& xml) String ValueTree::toXmlString() const { const ScopedPointer xml (createXml()); - return xml != nullptr ? xml->createDocument (String::empty) : String::empty; + return xml != nullptr ? xml->createDocument ("") : String(); } //============================================================================== diff --git a/modules/juce_events/interprocess/juce_InterprocessConnection.cpp b/modules/juce_events/interprocess/juce_InterprocessConnection.cpp index a76ff4d657..e22ff5b1d8 100644 --- a/modules/juce_events/interprocess/juce_InterprocessConnection.cpp +++ b/modules/juce_events/interprocess/juce_InterprocessConnection.cpp @@ -141,7 +141,7 @@ String InterprocessConnection::getConnectedHostName() const return "localhost"; } - return String::empty; + return String(); } //============================================================================== diff --git a/modules/juce_events/messages/juce_ApplicationBase.cpp b/modules/juce_events/messages/juce_ApplicationBase.cpp index a5610fa248..507823d1c2 100644 --- a/modules/juce_events/messages/juce_ApplicationBase.cpp +++ b/modules/juce_events/messages/juce_ApplicationBase.cpp @@ -134,7 +134,7 @@ struct JUCEApplicationBase::MultipleInstanceHandler {}; #if JUCE_ANDROID StringArray JUCEApplicationBase::getCommandLineParameterArray() { return StringArray(); } -String JUCEApplicationBase::getCommandLineParameters() { return String::empty; } +String JUCEApplicationBase::getCommandLineParameters() { return String(); } #else diff --git a/modules/juce_graphics/fonts/juce_CustomTypeface.cpp b/modules/juce_graphics/fonts/juce_CustomTypeface.cpp index 1ab1591910..c9d6e8de32 100644 --- a/modules/juce_graphics/fonts/juce_CustomTypeface.cpp +++ b/modules/juce_graphics/fonts/juce_CustomTypeface.cpp @@ -99,13 +99,13 @@ namespace CustomTypefaceHelpers //============================================================================== CustomTypeface::CustomTypeface() - : Typeface (String::empty, String::empty) + : Typeface (String(), String()) { clear(); } CustomTypeface::CustomTypeface (InputStream& serialisedTypefaceStream) - : Typeface (String::empty, String::empty) + : Typeface (String(), String()) { clear(); diff --git a/modules/juce_graphics/geometry/juce_Rectangle.h b/modules/juce_graphics/geometry/juce_Rectangle.h index 4c38837f37..ba480d09e0 100644 --- a/modules/juce_graphics/geometry/juce_Rectangle.h +++ b/modules/juce_graphics/geometry/juce_Rectangle.h @@ -865,7 +865,7 @@ public: static Rectangle fromString (StringRef stringVersion) { 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]), parseIntAfterSpace (toks[1]), diff --git a/modules/juce_graphics/native/juce_android_Fonts.cpp b/modules/juce_graphics/native/juce_android_Fonts.cpp index cbd311942b..ab782c4f36 100644 --- a/modules/juce_graphics/native/juce_android_Fonts.cpp +++ b/modules/juce_graphics/native/juce_android_Fonts.cpp @@ -291,7 +291,7 @@ private: file = getFontFile (family, "Regular"); if (! file.exists()) - file = getFontFile (family, String::empty); + file = getFontFile (family, String()); return file; } diff --git a/modules/juce_graphics/native/juce_freetype_Fonts.cpp b/modules/juce_graphics/native/juce_freetype_Fonts.cpp index 5b3f0f21d3..2ce9593ae3 100644 --- a/modules/juce_graphics/native/juce_freetype_Fonts.cpp +++ b/modules/juce_graphics/native/juce_freetype_Fonts.cpp @@ -111,7 +111,7 @@ public: const KnownTypeface* ftFace = matchTypeface (fontName, fontStyle); 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) { diff --git a/modules/juce_graphics/native/juce_linux_Fonts.cpp b/modules/juce_graphics/native/juce_linux_Fonts.cpp index cf54d62364..4a21c09038 100644 --- a/modules/juce_graphics/native/juce_linux_Fonts.cpp +++ b/modules/juce_graphics/native/juce_linux_Fonts.cpp @@ -43,7 +43,7 @@ StringArray FTTypefaceList::getDefaultFontDirectories() { 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()) xdgDataHome = "~/.local/share"; diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp b/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp index ad88cd01d7..4f4ff46c69 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp @@ -127,7 +127,7 @@ String ApplicationCommandManager::getNameOfCommand (const CommandID commandID) c if (const ApplicationCommandInfo* const ci = getCommandForID (commandID)) return ci->shortName; - return String::empty; + return String(); } String ApplicationCommandManager::getDescriptionOfCommand (const CommandID commandID) const noexcept @@ -136,7 +136,7 @@ String ApplicationCommandManager::getDescriptionOfCommand (const CommandID comma return ci->description.isNotEmpty() ? ci->description : ci->shortName; - return String::empty; + return String(); } StringArray ApplicationCommandManager::getCommandCategories() const diff --git a/modules/juce_gui_basics/drawables/juce_SVGParser.cpp b/modules/juce_gui_basics/drawables/juce_SVGParser.cpp index fa19b2e32f..198bfdbaac 100644 --- a/modules/juce_gui_basics/drawables/juce_SVGParser.cpp +++ b/modules/juce_gui_basics/drawables/juce_SVGParser.cpp @@ -944,7 +944,7 @@ private: } String getStyleAttribute (const XmlPath& xml, const String& attributeName, - const String& defaultValue = String::empty) const + const String& defaultValue = String()) const { if (xml->hasAttribute (attributeName)) return xml->getStringAttribute (attributeName, defaultValue); @@ -953,7 +953,7 @@ private: if (styleAtt.isNotEmpty()) { - const String value (getAttributeFromStyleList (styleAtt, attributeName, String::empty)); + const String value (getAttributeFromStyleList (styleAtt, attributeName, String())); if (value.isNotEmpty()) return value; @@ -991,7 +991,7 @@ private: if (xml.parent != nullptr) return getInheritedAttribute (*xml.parent, attributeName); - return String::empty; + return String(); } //============================================================================== @@ -1144,7 +1144,7 @@ private: StringArray tokens; tokens.addTokens (t.fromFirstOccurrenceOf ("(", false, false) .upToFirstOccurrenceOf (")", false, false), - ", ", String::empty); + ", ", ""); tokens.removeEmptyStrings (true); diff --git a/modules/juce_gui_basics/native/juce_mac_Windowing.mm b/modules/juce_gui_basics/native/juce_mac_Windowing.mm index 709993eeb7..7744d03879 100644 --- a/modules/juce_gui_basics/native/juce_mac_Windowing.mm +++ b/modules/juce_gui_basics/native/juce_mac_Windowing.mm @@ -439,7 +439,7 @@ String SystemClipboard::getTextFromClipboard() { NSString* text = [[NSPasteboard generalPasteboard] stringForType: NSStringPboardType]; - return text == nil ? String::empty + return text == nil ? String() : nsStringToJuce (text); } diff --git a/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp b/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp index 4c43a352cf..9ee0f16568 100644 --- a/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp +++ b/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp @@ -440,7 +440,7 @@ String TableHeaderComponent::toString() const e->setAttribute ("width", ci->width); } - return doc.createDocument (String::empty, true, false); + return doc.createDocument ("", true, false); } void TableHeaderComponent::restoreFromString (const String& storedVersion)