mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Android: Support content:// URI in love.filesystem.mountFullPath.
This commit is contained in:
@@ -398,6 +398,25 @@ bool Filesystem::mountFullPath(const char *archive, const char *mountpoint, Moun
|
|||||||
|
|
||||||
std::string canonarchive = canonicalizeRealPath(archive);
|
std::string canonarchive = canonicalizeRealPath(archive);
|
||||||
|
|
||||||
|
#ifdef LOVE_ANDROID
|
||||||
|
if (strncmp(archive, "content://", 10) == 0)
|
||||||
|
{
|
||||||
|
if (permissions == MOUNT_PERMISSIONS_READWRITE)
|
||||||
|
// Currently there's no way content:// URIs we got are for read-write.
|
||||||
|
// TODO: Re-evaluate this in the future, maybe?
|
||||||
|
return false;
|
||||||
|
|
||||||
|
auto io = (PHYSFS_Io *) love::android::getIOFromContentProtocol(archive);
|
||||||
|
if (!io)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (PHYSFS_mountIo(io, canonarchive.c_str(), mountpoint, appendToPath))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
io->destroy(io);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (permissions == MOUNT_PERMISSIONS_READWRITE)
|
if (permissions == MOUNT_PERMISSIONS_READWRITE)
|
||||||
return PHYSFS_mountRW(canonarchive.c_str(), mountpoint, appendToPath) != 0;
|
return PHYSFS_mountRW(canonarchive.c_str(), mountpoint, appendToPath) != 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user