소스 검색

Extended FilePathSeparator class

- added "getOperatingSystemSpecificSeparator" method to receive OS specific
file path separator
pcmattulat 4 년 전
부모
커밋
a39438aaa4
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 13 0
      source/io/FilePathSeparator.hpp

+ 13 - 0
source/io/FilePathSeparator.hpp

@@ -23,6 +23,19 @@ namespace ls_std {
         return '/';
       }
 
+      static char getOperatingSystemSpecificSeparator() {
+        char separator {};
+
+        #ifdef _WIN32
+          separator = ls_std::FilePathSeparator::getUnixFilePathSeparator();
+        #endif
+        #ifdef unix
+          separator = ls_std::FilePathSeparator::getLinuxFilePathSeparator();
+        #endif
+
+        return separator;
+      }
+
       static char getUnixFilePathSeparator() {
         return '\\';
       }