Explorar el Código

Moved file_separator to the new file API where it belongs.

David Piuva hace 5 años
padre
commit
5c582d37f4

+ 8 - 0
Source/DFPSR/api/fileAPI.cpp

@@ -81,4 +81,12 @@ void file_saveBuffer(const ReadableString& filename, Buffer buffer) {
 	}
 }
 
+const char32_t* file_separator() {
+	#if defined(WIN32) || defined(_WIN32)
+		return U"\\";
+	#else
+		return U"/";
+	#endif
+}
+
 }

+ 3 - 0
Source/DFPSR/api/fileAPI.h

@@ -40,6 +40,9 @@ namespace dsr {
 	// Side-effect: Saves buffer to filename as a binary file.
 	// Pre-condition: buffer exists
 	void file_saveBuffer(const ReadableString& filename, Buffer buffer);
+
+	// Get a path separator for the target operating system.
+	const char32_t* file_separator();
 }
 
 #endif

+ 0 - 8
Source/DFPSR/base/text.cpp

@@ -636,14 +636,6 @@ Buffer dsr::string_saveToMemory(const ReadableString& content, CharacterEncoding
 	return result;
 }
 
-const char32_t* dsr::file_separator() {
-	#ifdef _WIN32
-		return U"\\";
-	#else
-		return U"/";
-	#endif
-}
-
 int ReadableString::length() const {
 	return this->sectionLength;
 }

+ 0 - 9
Source/DFPSR/base/text.h

@@ -418,15 +418,6 @@ void throwError(ARGS... args) {
 	throwErrorMessage(result);
 }
 
-
-// ---------------- Hard-coded portability for specific operating systems ----------------
-// TODO: Try to find a place for this outside of the library, similar to how window managers were implemented
-
-
-// Get a path separator for the target operating system.
-const char32_t* file_separator();
-
-
 }
 
 #endif