From 041feb16883bd0ff7c76a6de5c8b21209a7f7d95 Mon Sep 17 00:00:00 2001 From: tpoole Date: Tue, 22 Aug 2017 16:19:39 +0100 Subject: [PATCH] Added operator<< bool to the String class --- modules/juce_core/text/juce_String.cpp | 2 ++ modules/juce_core/text/juce_String.h | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index d835bfc26a..ea96c60f3b 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -868,6 +868,8 @@ JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const uint64 number) JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const float number) { return s1 += String (number); } JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const double number) { return s1 += String (number); } +JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, bool b) { return s1 += String (b); } + JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const String& text) { return operator<< (stream, StringRef (text)); diff --git a/modules/juce_core/text/juce_String.h b/modules/juce_core/text/juce_String.h index 9b561d529e..1cc80e97d8 100644 --- a/modules/juce_core/text/juce_String.h +++ b/modules/juce_core/text/juce_String.h @@ -1323,23 +1323,26 @@ JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const String& string /** Appends a string to the end of the first one. */ JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, StringRef string2); -/** Appends a decimal number at the end of a string. */ +/** Appends a decimal number to the end of a string. */ JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, short number); -/** Appends a decimal number at the end of a string. */ +/** Appends a decimal number to the end of a string. */ JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, int number); -/** Appends a decimal number at the end of a string. */ +/** Appends a decimal number to the end of a string. */ JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, long number); -/** Appends a decimal number at the end of a string. */ +/** Appends a decimal number to the end of a string. */ JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, unsigned long number); -/** Appends a decimal number at the end of a string. */ +/** Appends a decimal number to the end of a string. */ JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, int64 number); -/** Appends a decimal number at the end of a string. */ +/** Appends a decimal number to the end of a string. */ JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, uint64 number); -/** Appends a decimal number at the end of a string. */ +/** Appends a decimal number to the end of a string. */ JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, float number); -/** Appends a decimal number at the end of a string. */ +/** Appends a decimal number to the end of a string. */ JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, double number); +/** Appends a boolean to the end of a string. */ +JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, bool boolean); + //============================================================================== /** Case-sensitive comparison of two strings. */ JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const String& string2) noexcept;