NewLine.cpp 669 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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-23
  7. *
  8. * */
  9. #include <ls-std/io/NewLine.hpp>
  10. using ls::std::io::NewLine;
  11. using std::string;
  12. NewLine::NewLine() = default;
  13. NewLine::~NewLine() = default;
  14. string NewLine::get()
  15. {
  16. string newLine{};
  17. #if defined(unix) || defined(__APPLE__)
  18. newLine = NewLine::getUnixNewLine();
  19. #endif
  20. #ifdef _WIN32
  21. newLine = NewLine::getWindowsNewLine();
  22. #endif
  23. return newLine;
  24. }
  25. string NewLine::getUnixNewLine()
  26. {
  27. return "\n";
  28. }
  29. string NewLine::getWindowsNewLine()
  30. {
  31. return "\r\n";
  32. }