Path: Recognize content URIs on every platform

So code that handles them can be tested anywhere. Elsewhere, file operations
on them just fail, as they did when they were taken for native paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-11-06 17:53:02 +01:00
1 parent a61893dcc1
commit b3aee84a8e
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -41,7 +41,9 @@ void Path::Init(std::string_view str) {
} else if (startsWith(str, "http://") || startsWith(str, "https://")) {
type_ = PathType::HTTP;
path_ = str;
} else if (Android_IsContentUri(str)) {
} else if (startsWith(str, "content://")) {
// Recognized on every platform, so code that handles them can be tested anywhere. Elsewhere, file
// operations on them just fail.
// Content URIs on non scoped-storage (and possibly other cases?) can contain
// "raw:/" URIs inside. This happens when picking the Download folder using the folder browser
// on Android 9.
+1 -1
View File
@@ -32,7 +32,7 @@
enum class PathType {
UNDEFINED = 0,
NATIVE = 1, // Can be relative.
CONTENT_URI = 2, // Android only. Can only be absolute!
CONTENT_URI = 2, // Android storage. Recognized everywhere, but only usable on Android. Can only be absolute!
HTTP = 3, // http://, https://
};