Browse Source

Extended FilePathSeparator class

- added "getOperatingSystemSpecificSeparator" method to receive OS specific
file path separator
pcmattulat 4 years ago
parent
commit
a39438aaa4
1 changed files with 13 additions and 0 deletions
  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 '\\';
       }