123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #ifndef FILE_PATH_SEPARATOR_HPP
- #define FILE_PATH_SEPARATOR_HPP
- #include <string>
- namespace ls_std {
- class FilePathSeparator {
- public:
- FilePathSeparator() = default;
- ~FilePathSeparator() = default;
- static char get() {
- char separator;
- #ifdef _WIN32
- separator = ls_std::FilePathSeparator::getWindowsFilePathSeparator();
- #endif
- #if defined(unix) || defined(__APPLE__)
- separator = ls_std::FilePathSeparator::getUnixFilePathSeparator();
- #endif
- return separator;
- }
- static char getUnixFilePathSeparator() {
- return '/';
- }
- static char getWindowsFilePathSeparator() {
- return '\\';
- }
- };
- }
- #endif
|