2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCE_NEWLINE_JUCEHEADER__
27 #define __JUCE_NEWLINE_JUCEHEADER__
30 //==============================================================================
31 /** This class is used for represent a new-line character sequence.
33 To write a new-line to a stream, you can use the predefined 'newLine' variable, e.g.
35 myOutputStream << "Hello World" << newLine << newLine;
38 The exact character sequence that will be used for the new-line can be set and
39 retrieved with OutputStream::setNewLineString() and OutputStream::getNewLineString().
41 class JUCE_API NewLine
44 /** Returns the default new-line sequence that the library uses.
45 @see OutputStream::setNewLineString()
47 static const char* getDefault() noexcept
{ return "\r\n"; }
49 /** Returns the default new-line sequence that the library uses.
52 operator String() const { return getDefault(); }
55 //==============================================================================
56 /** A predefined object representing a new-line, which can be written to a string or stream.
58 To write a new-line to a stream, you can use the predefined 'newLine' variable like this:
60 myOutputStream << "Hello World" << newLine << newLine;
63 extern NewLine newLine
;
65 //==============================================================================
66 /** Writes a new-line sequence to a string.
67 You can use the predefined object 'newLine' to invoke this, e.g.
69 myString << "Hello World" << newLine << newLine;
72 JUCE_API String
& JUCE_CALLTYPE
operator<< (String
& string1
, const NewLine
&);
75 #endif // __JUCE_NEWLINE_JUCEHEADER__