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

New class: NewLine, which provides a clean way to write new-line sequences to streams or strings, and a way to customise the new-line sequence used by an OutputStream.

This commit is contained in:
Julian Storer 2010-12-20 22:12:48 +00:00
parent 2bb0c77216
commit c8799c9107
15 changed files with 327 additions and 271 deletions

View file

@ -46,6 +46,8 @@ BEGIN_JUCE_NAMESPACE
#error "JUCE_STRINGS_ARE_UNICODE is deprecated! All strings are now unicode by default."
#endif
NewLine newLine;
//==============================================================================
class StringHolder
{
@ -779,6 +781,11 @@ JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const Str
return stream;
}
JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const NewLine&)
{
return string1 += NewLine::getDefault();
}
//==============================================================================
int String::indexOfChar (const juce_wchar character) const throw()
{
@ -2167,7 +2174,6 @@ void String::copyToUnicode (juce_wchar* const destBuffer, const int maxCharsToCo
StringHolder::copyChars (destBuffer, text, jmin (maxCharsToCopy, length()));
}
//==============================================================================
String::Concatenator::Concatenator (String& stringToAppendTo)
: result (stringToAppendTo),
@ -2191,6 +2197,9 @@ void String::Concatenator::append (const String& s)
}
}
//==============================================================================
//==============================================================================
#if JUCE_UNIT_TESTS
#include "../utilities/juce_UnitTest.h"