Fix crash when host does not support midi-in; Add missing file
[juce-lv2.git] / juce / source / src / text / juce_NewLine.h
blobc8dda47271299fbb24315a4dd8bce8e06073165f
1 /*
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.
34 @code
35 myOutputStream << "Hello World" << newLine << newLine;
36 @endcode
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
43 public:
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.
50 @see getDefault()
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:
59 @code
60 myOutputStream << "Hello World" << newLine << newLine;
61 @endcode
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.
68 @code
69 myString << "Hello World" << newLine << newLine;
70 @endcode
72 JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const NewLine&);
75 #endif // __JUCE_NEWLINE_JUCEHEADER__