NewLine.cpp 740 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-04
  6. * Changed: 2023-02-04
  7. *
  8. * */
  9. #include <ls-std/io/NewLine.hpp>
  10. ls::std::io::NewLine::NewLine() = default;
  11. ls::std::io::NewLine::~NewLine() = default;
  12. ::std::string ls::std::io::NewLine::get()
  13. {
  14. ::std::string newLine{};
  15. #if defined(unix) || defined(__APPLE__)
  16. newLine = ls::std::io::NewLine::getUnixNewLine();
  17. #endif
  18. #ifdef _WIN32
  19. newLine = ls::std::io::NewLine::getWindowsNewLine();
  20. #endif
  21. return newLine;
  22. }
  23. ::std::string ls::std::io::NewLine::getUnixNewLine()
  24. {
  25. return "\n";
  26. }
  27. ::std::string ls::std::io::NewLine::getWindowsNewLine()
  28. {
  29. return "\r\n";
  30. }