NewLine.cpp 708 B

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