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

Cleaned up a few String::empty uses

This commit is contained in:
jules 2015-12-21 12:01:28 +00:00
parent 79d2a40035
commit ae712c72d8
16 changed files with 40 additions and 40 deletions

View file

@ -982,7 +982,7 @@ String MidiMessage::getMidiNoteName (int note, bool useSharps, bool includeOctav
return s;
}
return String::empty;
return String();
}
double MidiMessage::getMidiNoteInHertz (int noteNumber, const double frequencyOfA) noexcept

View file

@ -45,7 +45,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

View file

@ -354,7 +354,7 @@ public:
hr = pOutputBuffer->Play (0, 0, 1 /* DSBPLAY_LOOPING */);
if (SUCCEEDED (hr))
return String::empty;
return String();
}
}
}
@ -597,7 +597,7 @@ public:
hr = pInputBuffer->Start (1 /* DSCBSTART_LOOPING */);
if (SUCCEEDED (hr))
return String::empty;
return String();
}
}

View file

@ -845,7 +845,7 @@ namespace WavFileHelpers
static MemoryBlock createFrom (const StringPairArray& values)
{
const String ISRC (values.getValue (WavAudioFormat::ISRC, String::empty));
const String ISRC (values.getValue (WavAudioFormat::ISRC, String()));
MemoryOutputStream xml;
if (ISRC.isNotEmpty())

View file

@ -1675,7 +1675,7 @@ public:
//==============================================================================
const String getName() const override
{
return module != nullptr ? module->name : String::empty;
return module != nullptr ? module->name : String();
}
void repopulateArrangements()
@ -1837,7 +1837,7 @@ public:
return toString (busInfo.name);
}
return String::empty;
return String();
}
const String getInputChannelName (int channelIndex) const override { return getChannelName (channelIndex, true, true); }
@ -1941,7 +1941,7 @@ public:
return toString (result);
}
return String::empty;
return String();
}
void setParameter (int parameterIndex, float newValue) override

View file

@ -469,7 +469,7 @@ public:
}
}
return String::empty;
return String();
}
#endif
#else
@ -1024,7 +1024,7 @@ public:
return String (pinProps.label, sizeof (pinProps.label));
}
return String::empty;
return String();
}
bool isInputChannelStereoPair (int index) const override
@ -1048,7 +1048,7 @@ public:
return String (pinProps.label, sizeof (pinProps.label));
}
return String::empty;
return String();
}
bool isOutputChannelStereoPair (int index) const override
@ -1750,7 +1750,7 @@ private:
String getTextForOpcode (const int index, const AEffectOpcodes opcode) const
{
if (effect == nullptr)
return String::empty;
return String();
jassert (index >= 0 && index < effect->numParams);
char nm [256] = { 0 };
@ -1775,7 +1775,7 @@ private:
if (index >= 0 && programNames[index].isEmpty())
{
while (programNames.size() < index)
programNames.add (String::empty);
programNames.add (String());
programNames.set (index, progName);
}

View file

@ -60,7 +60,7 @@ public:
e.g. "HKEY_CURRENT_USER\Software\foo\bar"
*/
static String JUCE_CALLTYPE getValue (const String& regValuePath,
const String& defaultValue = String::empty,
const String& defaultValue = String(),
WoW64Mode mode = WoW64_Default);
/** Reads a binary block from the registry.
@ -128,7 +128,7 @@ public:
WoW64Mode mode = WoW64_Default);
// DEPRECATED: use the other methods with a WoW64Mode parameter of WoW64_64bit instead.
JUCE_DEPRECATED (static String getValueWow64 (const String&, const String& defaultValue = String::empty));
JUCE_DEPRECATED (static String getValueWow64 (const String&, const String& defaultValue = String()));
JUCE_DEPRECATED (static bool valueExistsWow64 (const String&));
JUCE_DEPRECATED (static bool keyExistsWow64 (const String&));

View file

@ -43,7 +43,7 @@ bool File::isOnRemovableDrive() const
String File::getVersion() const
{
return String::empty;
return String();
}
File File::getSpecialLocation (const SpecialLocationType type)

View file

@ -205,9 +205,9 @@ void UnitTestRunner::endTest()
m << r->failures << (r->failures == 1 ? " test" : " tests")
<< " failed, out of a total of " << (r->passes + r->failures);
logMessage (String::empty);
logMessage (String());
logMessage (m);
logMessage (String::empty);
logMessage (String());
}
else
{

View file

@ -136,13 +136,13 @@ public:
If testResult is true, a pass is logged; if it's false, a failure is logged.
If the failure message is specified, it will be written to the log if the test fails.
*/
void expect (bool testResult, const String& failureMessage = String::empty);
void expect (bool testResult, const String& failureMessage = String());
/** Compares two values, and if they don't match, prints out a message containing the
expected and actual result values.
*/
template <class ValueType>
void expectEquals (ValueType actual, ValueType expected, String failureMessage = String::empty)
void expectEquals (ValueType actual, ValueType expected, String failureMessage = String())
{
const bool result = (actual == expected);

View file

@ -172,7 +172,7 @@ String XmlDocument::getFileContents (const String& filename) const
return in->readEntireStreamAsString();
}
return String::empty;
return String();
}
juce_wchar XmlDocument::readNextChar() noexcept

View file

@ -134,7 +134,7 @@
}
// now we can turn the whole thing into a text document..
String myXmlDoc = animalsList.createDocument (String::empty);
String myXmlDoc = animalsList.createDocument (String());
@endcode
@see XmlDocument

View file

@ -2757,7 +2757,7 @@ private:
reset();
if (TextInputTarget* const target = owner.findCurrentTextInputTarget())
target->insertTextAtCaret (String::empty);
target->insertTextAtCaret (String());
}
void handleEndComposition (ComponentPeer& owner, HWND hWnd)
@ -2768,7 +2768,7 @@ private:
if (TextInputTarget* const target = owner.findCurrentTextInputTarget())
{
target->setHighlightedRegion (compositionRange);
target->insertTextAtCaret (String::empty);
target->insertTextAtCaret (String());
compositionRange.setLength (0);
target->setHighlightedRegion (Range<int>::emptyRange (compositionRange.getEnd()));
@ -2843,7 +2843,7 @@ private:
return String (buffer);
}
return String::empty;
return String();
}
int getCompositionCaretPos (HIMC hImc, LPARAM lParam, const String& currentIMEString) const

View file

@ -131,7 +131,7 @@ public:
*/
void addTextEditor (const String& name,
const String& initialContents,
const String& onScreenLabel = String::empty,
const String& onScreenLabel = String(),
bool isPasswordBox = false);
/** Returns the contents of a named textbox.
@ -161,7 +161,7 @@ public:
*/
void addComboBox (const String& name,
const StringArray& items,
const String& onScreenLabel = String::empty);
const String& onScreenLabel = String());
/** Returns a drop-down list that was added to the AlertWindow.
@ -246,7 +246,7 @@ public:
static void JUCE_CALLTYPE showMessageBox (AlertIconType iconType,
const String& title,
const String& message,
const String& buttonText = String::empty,
const String& buttonText = String(),
Component* associatedComponent = nullptr);
#endif
@ -274,7 +274,7 @@ public:
static void JUCE_CALLTYPE showMessageBoxAsync (AlertIconType iconType,
const String& title,
const String& message,
const String& buttonText = String::empty,
const String& buttonText = String(),
Component* associatedComponent = nullptr,
ModalComponentManager::Callback* callback = nullptr);
@ -317,8 +317,8 @@ public:
const String& title,
const String& message,
#if JUCE_MODAL_LOOPS_PERMITTED
const String& button1Text = String::empty,
const String& button2Text = String::empty,
const String& button1Text = String(),
const String& button2Text = String(),
Component* associatedComponent = nullptr,
ModalComponentManager::Callback* callback = nullptr);
#else
@ -371,9 +371,9 @@ public:
const String& title,
const String& message,
#if JUCE_MODAL_LOOPS_PERMITTED
const String& button1Text = String::empty,
const String& button2Text = String::empty,
const String& button3Text = String::empty,
const String& button1Text = String(),
const String& button2Text = String(),
const String& button3Text = String(),
Component* associatedComponent = nullptr,
ModalComponentManager::Callback* callback = nullptr);
#else

View file

@ -433,7 +433,7 @@ String CodeDocument::Position::getLineText() const
if (const CodeDocumentLine* const l = owner->lines [line])
return l->line;
return String::empty;
return String();
}
void CodeDocument::Position::setPositionMaintained (const bool isMaintained)
@ -482,7 +482,7 @@ String CodeDocument::getAllContent() const
String CodeDocument::getTextBetween (const Position& start, const Position& end) const
{
if (end.getPosition() <= start.getPosition())
return String::empty;
return String();
const int startLine = start.getLineNumber();
const int endLine = end.getLineNumber();
@ -492,7 +492,7 @@ String CodeDocument::getTextBetween (const Position& start, const Position& end)
if (CodeDocumentLine* const line = lines [startLine])
return line->line.substring (start.getIndexInLine(), end.getIndexInLine());
return String::empty;
return String();
}
MemoryOutputStream mo;
@ -537,7 +537,7 @@ String CodeDocument::getLine (const int lineIndex) const noexcept
if (const CodeDocumentLine* const line = lines [lineIndex])
return line->line;
return String::empty;
return String();
}
int CodeDocument::getMaximumLineLength() noexcept
@ -634,7 +634,7 @@ void CodeDocument::setNewLineCharacters (const String& newChars) noexcept
void CodeDocument::newTransaction()
{
undoManager.beginNewTransaction (String::empty);
undoManager.beginNewTransaction (String());
}
void CodeDocument::undo()

View file

@ -870,7 +870,7 @@ void CodeEditorComponent::indentSelectedLines (const int spacesToAdd)
void CodeEditorComponent::cut()
{
insertText (String::empty);
insertText (String());
}
bool CodeEditorComponent::copyToClipboard()