1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

NewLine: Add support for strings appearing on the opposite side of the plus operator

This commit is contained in:
Anthony Nicholls 2025-07-02 17:06:44 +02:00 committed by Anthony Nicholls
parent 4ed15dbc9e
commit 51b46f3cd1

View file

@ -85,10 +85,12 @@ extern NewLine newLine;
@endcode
*/
inline String& operator<< (String& string1, const NewLine&) { return string1 += NewLine::getDefault(); }
inline String& operator+= (String& s1, const NewLine&) { return s1 += NewLine::getDefault(); }
inline String& operator+= (String& s, const NewLine&) { return s += NewLine::getDefault(); }
inline String operator+ (const NewLine&, const NewLine&) { return String (NewLine::getDefault()) + NewLine::getDefault(); }
inline String operator+ (String s1, const NewLine&) { return s1 += NewLine::getDefault(); }
inline String operator+ (const NewLine&, const char* s2) { return String (NewLine::getDefault()) + s2; }
inline String operator+ (String s, const NewLine&) { return s += NewLine::getDefault(); }
inline String operator+ (const NewLine&, String s) { return NewLine::getDefault() + s; }
inline String operator+ (const NewLine&, const char* s) { return String (NewLine::getDefault()) + s; }
inline String operator+ (const char* s, const NewLine&) { return s + String (NewLine::getDefault()); }
} // namespace juce