Bladeren bron

Extended FilePathSeparator class

- added "getOperatingSystemSpecificSeparator" method to receive OS specific
file path separator
pcmattulat 4 jaren geleden
bovenliggende
commit
a39438aaa4
1 gewijzigde bestanden met toevoegingen van 13 en 0 verwijderingen
  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 '\\';
       }