The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.9KB

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