Browse Source

Removed a few more uses of String::empty.

tags/2021-05-28
jules 12 years ago
parent
commit
2edec00b55
46 changed files with 91 additions and 91 deletions
  1. +1
    -1
      extras/Introjucer/Source/ComponentEditor/jucer_ComponentLayout.cpp
  2. +1
    -1
      extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp
  3. +1
    -1
      extras/Introjucer/Source/ComponentEditor/jucer_PaintRoutine.cpp
  4. +4
    -4
      modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp
  5. +1
    -1
      modules/juce_audio_devices/native/juce_android_OpenSL.cpp
  6. +1
    -1
      modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp
  7. +1
    -1
      modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp
  8. +4
    -4
      modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  9. +6
    -6
      modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp
  10. +2
    -2
      modules/juce_audio_processors/processors/juce_AudioProcessor.cpp
  11. +6
    -6
      modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp
  12. +3
    -3
      modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h
  13. +1
    -1
      modules/juce_core/containers/juce_PropertySet.cpp
  14. +1
    -1
      modules/juce_core/containers/juce_PropertySet.h
  15. +4
    -4
      modules/juce_core/files/juce_File.cpp
  16. +1
    -1
      modules/juce_core/files/juce_TemporaryFile.h
  17. +1
    -1
      modules/juce_core/maths/juce_BigInteger.cpp
  18. +2
    -2
      modules/juce_core/maths/juce_Expression.cpp
  19. +1
    -1
      modules/juce_core/native/juce_linux_Files.cpp
  20. +3
    -3
      modules/juce_core/native/juce_linux_Network.cpp
  21. +4
    -4
      modules/juce_core/native/juce_linux_SystemStats.cpp
  22. +1
    -1
      modules/juce_core/native/juce_mac_Files.mm
  23. +1
    -1
      modules/juce_core/native/juce_mac_Strings.mm
  24. +4
    -4
      modules/juce_core/native/juce_mac_SystemStats.mm
  25. +1
    -1
      modules/juce_core/native/juce_posix_SharedCode.h
  26. +1
    -1
      modules/juce_core/network/juce_IPAddress.cpp
  27. +1
    -1
      modules/juce_core/network/juce_Socket.h
  28. +4
    -4
      modules/juce_core/network/juce_URL.cpp
  29. +1
    -1
      modules/juce_core/network/juce_URL.h
  30. +1
    -1
      modules/juce_core/text/juce_StringArray.cpp
  31. +3
    -3
      modules/juce_core/text/juce_StringPool.cpp
  32. +2
    -2
      modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp
  33. +2
    -2
      modules/juce_data_structures/undomanager/juce_UndoManager.cpp
  34. +2
    -2
      modules/juce_data_structures/undomanager/juce_UndoManager.h
  35. +2
    -2
      modules/juce_data_structures/values/juce_ValueTree.cpp
  36. +1
    -1
      modules/juce_events/interprocess/juce_InterprocessConnection.cpp
  37. +1
    -1
      modules/juce_events/messages/juce_ApplicationBase.cpp
  38. +2
    -2
      modules/juce_graphics/fonts/juce_CustomTypeface.cpp
  39. +1
    -1
      modules/juce_graphics/geometry/juce_Rectangle.h
  40. +1
    -1
      modules/juce_graphics/native/juce_android_Fonts.cpp
  41. +1
    -1
      modules/juce_graphics/native/juce_freetype_Fonts.cpp
  42. +1
    -1
      modules/juce_graphics/native/juce_linux_Fonts.cpp
  43. +2
    -2
      modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp
  44. +4
    -4
      modules/juce_gui_basics/drawables/juce_SVGParser.cpp
  45. +1
    -1
      modules/juce_gui_basics/native/juce_mac_Windowing.mm
  46. +1
    -1
      modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp

+ 1
- 1
extras/Introjucer/Source/ComponentEditor/jucer_ComponentLayout.cpp 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()


+ 1
- 1
extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp View File

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


+ 1
- 1
extras/Introjucer/Source/ComponentEditor/jucer_PaintRoutine.cpp 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()


+ 4
- 4
modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp View File

@@ -408,15 +408,15 @@ String AudioDeviceManager::setAudioDeviceSetup (const AudioDeviceSetup& newSetup
jassert (&newSetup != &currentSetup); // 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


+ 1
- 1
modules/juce_audio_devices/native/juce_android_OpenSL.cpp View File

@@ -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


+ 1
- 1
modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp View File

@@ -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);


+ 1
- 1
modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp View File

@@ -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())
{


+ 4
- 4
modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm View File

@@ -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)); }


+ 6
- 6
modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp View File

@@ -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)


+ 2
- 2
modules/juce_audio_processors/processors/juce_AudioProcessor.cpp View File

@@ -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);
}


+ 6
- 6
modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp View File

@@ -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&) {}


+ 3
- 3
modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h View File

@@ -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&);


+ 1
- 1
modules/juce_core/containers/juce_PropertySet.cpp View File

@@ -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


+ 1
- 1
modules/juce_core/containers/juce_PropertySet.h View File

@@ -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.


+ 4
- 4
modules/juce_core/files/juce_File.cpp View File

@@ -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


+ 1
- 1
modules/juce_core/files/juce_TemporaryFile.h View File

@@ -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.


+ 1
- 1
modules/juce_core/maths/juce_BigInteger.cpp View File

@@ -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);


+ 2
- 2
modules/juce_core/maths/juce_Expression.cpp View File

@@ -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();
}

+ 1
- 1
modules/juce_core/native/juce_linux_Files.cpp View File

@@ -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
}
//==============================================================================


+ 3
- 3
modules/juce_core/native/juce_linux_Network.cpp View File

@@ -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)


+ 4
- 4
modules/juce_core/native/juce_linux_SystemStats.cpp View File

@@ -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)


+ 1
- 1
modules/juce_core/native/juce_mac_Files.mm View File

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


+ 1
- 1
modules/juce_core/native/juce_mac_Strings.mm View File

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


+ 4
- 4
modules/juce_core/native/juce_mac_SystemStats.mm View File

@@ -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 <const char*> (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)


+ 1
- 1
modules/juce_core/native/juce_posix_SharedCode.h View File

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


+ 1
- 1
modules/juce_core/network/juce_IPAddress.cpp View File

@@ -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();


+ 1
- 1
modules/juce_core/network/juce_Socket.h View File

@@ -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.


+ 4
- 4
modules/juce_core/network/juce_URL.cpp View File

@@ -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());
}

+ 1
- 1
modules/juce_core/network/juce_URL.h View File

@@ -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;


+ 1
- 1
modules/juce_core/text/juce_StringArray.cpp View File

@@ -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);


+ 3
- 3
modules/juce_core/text/juce_StringPool.cpp View File

@@ -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);
}


+ 2
- 2
modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp View File

@@ -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;


+ 2
- 2
modules/juce_data_structures/undomanager/juce_UndoManager.cpp View File

@@ -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


+ 2
- 2
modules/juce_data_structures/undomanager/juce_UndoManager.h View File

@@ -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.


+ 2
- 2
modules/juce_data_structures/values/juce_ValueTree.cpp View File

@@ -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<XmlElement> xml (createXml());
return xml != nullptr ? xml->createDocument (String::empty) : String::empty;
return xml != nullptr ? xml->createDocument ("") : String();
}
//==============================================================================


+ 1
- 1
modules/juce_events/interprocess/juce_InterprocessConnection.cpp View File

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


+ 1
- 1
modules/juce_events/messages/juce_ApplicationBase.cpp View File

@@ -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


+ 2
- 2
modules/juce_graphics/fonts/juce_CustomTypeface.cpp View File

@@ -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();


+ 1
- 1
modules/juce_graphics/geometry/juce_Rectangle.h View File

@@ -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]),


+ 1
- 1
modules/juce_graphics/native/juce_android_Fonts.cpp View File

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


+ 1
- 1
modules/juce_graphics/native/juce_freetype_Fonts.cpp View File

@@ -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)
{


+ 1
- 1
modules/juce_graphics/native/juce_linux_Fonts.cpp View File

@@ -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";


+ 2
- 2
modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp View File

@@ -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


+ 4
- 4
modules/juce_gui_basics/drawables/juce_SVGParser.cpp View File

@@ -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);


+ 1
- 1
modules/juce_gui_basics/native/juce_mac_Windowing.mm View File

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


+ 1
- 1
modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp View File

@@ -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)


Loading…
Cancel
Save