Move FixPathCase to Common/File/Path

This commit is contained in:
Henrik Rydgård committed 2021-09-11 21:17:23 +02:00
1 parent d876834561
commit de3d711616
6 files changed
+145 -147

No files matched your search

-30
View File
@@ -28,36 +28,6 @@
typedef void * HANDLE;
#endif
#if defined(__APPLE__)
#if TARGET_OS_IPHONE
#define HOST_IS_CASE_SENSITIVE 1
#elif TARGET_IPHONE_SIMULATOR
#define HOST_IS_CASE_SENSITIVE 0
#else
// Mac OSX case sensitivity defaults off, but is user configurable (when
// creating a filesytem), so assume the worst:
#define HOST_IS_CASE_SENSITIVE 1
#endif
#elif defined(_WIN32)
#define HOST_IS_CASE_SENSITIVE 0
#else // Android, Linux, BSD (and the rest?)
#define HOST_IS_CASE_SENSITIVE 1
#endif
#if HOST_IS_CASE_SENSITIVE
enum FixPathCaseBehavior {
FPC_FILE_MUST_EXIST, // all path components must exist (rmdir, move from)
FPC_PATH_MUST_EXIST, // all except the last one must exist - still tries to fix last one (fopen, move to)
FPC_PARTIAL_ALLOWED, // don't care how many exist (mkdir recursive)
};
bool FixPathCase(const Path &basePath, std::string &path, FixPathCaseBehavior behavior);
#endif
struct DirectoryFileHandle {
enum Flags {
NORMAL,