LMMS
Loading...
Searching...
No Matches
NewLine.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the Water library.
5 Copyright (c) 2016 ROLI Ltd.
6 Copyright (C) 2017-2019 Filipe Coelho <falktx@falktx.com>
7
8 Permission is granted to use this software under the terms of the ISC license
9 http://www.isc.org/downloads/software-support-policy/isc-license/
10
11 Permission to use, copy, modify, and/or distribute this software for any
12 purpose with or without fee is hereby granted, provided that the above
13 copyright notice and this permission notice appear in all copies.
14
15 THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD
16 TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
18 OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
19 USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
21 OF THIS SOFTWARE.
22
23 ==============================================================================
24*/
25
26#ifndef WATER_NEWLINE_H_INCLUDED
27#define WATER_NEWLINE_H_INCLUDED
28
29#include "../water.h"
30
31namespace water {
32
33//==============================================================================
45{
46public:
50 static const char* getDefault() noexcept { return "\r\n"; }
51
55 operator String() const { return getDefault(); }
56
60 operator StringRef() const noexcept { return getDefault(); }
61};
62
63//==============================================================================
70inline String& operator<< (String& string1, const NewLine&) { return string1 += NewLine::getDefault(); }
71inline String& operator+= (String& s1, const NewLine&) { return s1 += NewLine::getDefault(); }
72
74inline String operator+ (String s1, const NewLine&) { return s1 += NewLine::getDefault(); }
75inline String operator+ (const NewLine&, const char* s2) { return String (NewLine::getDefault()) + s2; }
76
77}
78
79#endif // WATER_NEWLINE_H_INCLUDED
#define noexcept
Definition DistrhoDefines.h:72
Definition NewLine.h:45
static const char * getDefault() noexcept
Definition NewLine.h:50
Definition String.h:48
Definition StringRef.h:67
Definition AudioSampleBuffer.h:33
String & operator+=(String &s1, const NewLine &)
Definition NewLine.h:71
String operator+(const NewLine &, const NewLine &)
Definition NewLine.h:73
OutputStream & operator<<(OutputStream &stream, const MemoryOutputStream &streamToRead)
Definition MemoryOutputStream.cpp:194
#define const
Definition zconf.h:137