|
|
@ -528,38 +528,41 @@ void IterateDirEntriesRecursively(const std::filesystem::path& path,
|
|
|
|
// Generic Filesystem Operations
|
|
|
|
// Generic Filesystem Operations
|
|
|
|
|
|
|
|
|
|
|
|
bool Exists(const fs::path& path) {
|
|
|
|
bool Exists(const fs::path& path) {
|
|
|
|
|
|
|
|
std::error_code ec;
|
|
|
|
#ifdef ANDROID
|
|
|
|
#ifdef ANDROID
|
|
|
|
if (Android::IsContentUri(path)) {
|
|
|
|
if (Android::IsContentUri(path)) {
|
|
|
|
return Android::Exists(path);
|
|
|
|
return Android::Exists(path);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return fs::exists(path);
|
|
|
|
return fs::exists(path, ec);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
return fs::exists(path);
|
|
|
|
return fs::exists(path, ec);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool IsFile(const fs::path& path) {
|
|
|
|
bool IsFile(const fs::path& path) {
|
|
|
|
|
|
|
|
std::error_code ec;
|
|
|
|
#ifdef ANDROID
|
|
|
|
#ifdef ANDROID
|
|
|
|
if (Android::IsContentUri(path)) {
|
|
|
|
if (Android::IsContentUri(path)) {
|
|
|
|
return !Android::IsDirectory(path);
|
|
|
|
return !Android::IsDirectory(path);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return fs::is_regular_file(path);
|
|
|
|
return fs::is_regular_file(path, ec);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
return fs::is_regular_file(path);
|
|
|
|
return fs::is_regular_file(path, ec);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool IsDir(const fs::path& path) {
|
|
|
|
bool IsDir(const fs::path& path) {
|
|
|
|
|
|
|
|
std::error_code ec;
|
|
|
|
#ifdef ANDROID
|
|
|
|
#ifdef ANDROID
|
|
|
|
if (Android::IsContentUri(path)) {
|
|
|
|
if (Android::IsContentUri(path)) {
|
|
|
|
return Android::IsDirectory(path);
|
|
|
|
return Android::IsDirectory(path);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return fs::is_directory(path);
|
|
|
|
return fs::is_directory(path, ec);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
return fs::is_directory(path);
|
|
|
|
return fs::is_directory(path, ec);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|