123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- /*
- * Author: Patrick-Christopher Mattulat
- * Company: Lynar Studios
- * E-Mail: webmaster@lynarstudios.com
- * Created: 2020-08-15
- * Changed: 2022-07-03
- *
- * */
- #ifndef FILE_PATH_SEPARATOR_HPP
- #define FILE_PATH_SEPARATOR_HPP
- #include <string>
- #include <ls_std/os/dynamic_goal.hpp>
- namespace ls::std::io
- {
- class LS_STD_DYNAMIC_GOAL FilePathSeparator
- {
- public:
- FilePathSeparator() = default;
- ~FilePathSeparator() = default;
- static char get()
- {
- char separator;
- #ifdef _WIN32
- separator = ls::std::io::FilePathSeparator::getWindowsFilePathSeparator();
- #endif
- #if defined(unix) || defined(__APPLE__)
- separator = ls::std::io::FilePathSeparator::getUnixFilePathSeparator();
- #endif
- return separator;
- }
- static char getUnixFilePathSeparator()
- {
- return '/';
- }
- static char getWindowsFilePathSeparator()
- {
- return '\\';
- }
- };
- }
- #endif
|