FS: Stub TWL_PHOTO

This commit is contained in:
wheremyfoodat 2024-12-08 22:33:14 +02:00
parent 4d4029ab51
commit b436fdca64
7 changed files with 223 additions and 146 deletions

View file

@ -87,7 +87,7 @@ HorizonResult SystemSaveDataArchive::createFile(const FSPath& path, u64 size) {
HorizonResult SystemSaveDataArchive::createDirectory(const FSPath& path) {
if (path.type == PathType::UTF16) {
if (!isPathSafe<PathType::UTF16>(path)) {
Helpers::panic("Unsafe path in SystemSaveData::OpenFile");
Helpers::panic("Unsafe path in SystemSaveData::CreateDirectory");
}
fs::path p = IOFile::getAppData() / ".." / "SharedFiles" / "SystemSaveData";

View file

@ -0,0 +1,40 @@
#include <algorithm>
#include <memory>
#include "fs/archive_twl_photo.hpp"
namespace fs = std::filesystem;
HorizonResult TWLPhotoArchive::createFile(const FSPath& path, u64 size) {
Helpers::panic("[TWL_PHOTO] CreateFile not yet supported");
return Result::Success;
}
HorizonResult TWLPhotoArchive::deleteFile(const FSPath& path) {
Helpers::panic("[TWL_PHOTO] Unimplemented DeleteFile");
return Result::Success;
}
HorizonResult TWLPhotoArchive::createDirectory(const FSPath& path) {
Helpers::panic("[TWL_PHOTO] CreateDirectory not yet supported");
return Result::Success;
}
FileDescriptor TWLPhotoArchive::openFile(const FSPath& path, const FilePerms& perms) {
Helpers::panic("[TWL_PHOTO] OpenFile not yet supported");
return FileError;
}
Rust::Result<ArchiveBase*, HorizonResult> TWLPhotoArchive::openArchive(const FSPath& path) {
if (path.type != PathType::Empty) {
Helpers::panic("Unimplemented path type for TWLPhotoArchive::OpenArchive");
}
Helpers::warn("Unimplemented: TWL_PHOTO archive");
return Err(Result::FailurePlaceholder);
}
Rust::Result<DirectorySession, HorizonResult> TWLPhotoArchive::openDirectory(const FSPath& path) {
Helpers::panic("[TWL_PHOTO] OpenDirectory not yet supported");
return Err(Result::FailurePlaceholder);
}

View file

@ -99,6 +99,9 @@ ArchiveBase* FSService::getArchiveFromID(u32 id, const FSPath& archivePath) {
case ArchiveID::SDMC: return &sdmc;
case ArchiveID::SDMCWriteOnly: return &sdmcWriteOnly;
case ArchiveID::SavedataAndNcch: return &ncch; // This can only access NCCH outside of FSPXI
case ArchiveID::TwlPhoto: return &twlPhoto;
default:
Helpers::panic("Unknown archive. ID: %d\n", id);
return nullptr;