123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- /*
- * Author: Patrick-Christopher Mattulat
- * Company: Lynar Studios
- * E-Mail: webmaster@lynarstudios.com
- * Created: 2020-08-18
- * Changed: 2022-07-01
- *
- * */
- #ifndef LS_STD_NEW_LINE_HPP
- #define LS_STD_NEW_LINE_HPP
- #include <string>
- #include <ls_std/os/dynamic_goal.hpp>
- namespace ls
- {
- namespace std
- {
- namespace io
- {
- class DYNAMIC_GOAL NewLine
- {
- public:
- NewLine() = default;
- ~NewLine() = default;
- static ::std::string get()
- {
- ::std::string newLine{};
- #if defined(unix) || defined(__APPLE__)
- newLine = ls::std::io::NewLine::getUnixNewLine();
- #endif
- #ifdef _WIN32
- newLine = ls::std::io::NewLine::getWindowsNewLine();
- #endif
- return newLine;
- }
- static ::std::string getUnixNewLine()
- {
- return "\n";
- }
- static ::std::string getWindowsNewLine()
- {
- return "\r\n";
- }
- };
- }
- }
- }
- #endif
|