Procházet zdrojové kódy

Extended FilePathSeparator class

- added "getOperatingSystemSpecificSeparator" method to receive OS specific
file path separator
pcmattulat před 4 roky
rodič
revize
a39438aaa4
1 změnil soubory, kde provedl 13 přidání a 0 odebrání
  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 '\\';
       }