32 size_t GetBaseOffset()
override {
34 return util::AlignUp(this->header.header_size + this->fat.block_size + this->fnt.block_size, 0x4) +
sizeof(FileImageBlock);
37 size_t GetFatEntriesOffset()
override {
38 return sizeof(Header) +
sizeof(FileAllocationTableBlock);
41 size_t GetFatEntryCount()
override {
42 return this->fat.entry_count;
45 Result OnFileSystemWrite(fs::BinaryFile &w_bf,
const ssize_t size_diff)
override {
46 this->header.file_size += size_diff;
47 this->fimg.block_size += size_diff;
49 NTR_R_TRY(w_bf.SetAbsoluteOffset(0));
50 NTR_R_TRY(w_bf.Write(this->header));
52 const auto fimg_offset = this->header.header_size + this->fat.block_size + this->fnt.block_size;
53 NTR_R_TRY(w_bf.SetAbsoluteOffset(fimg_offset));
54 NTR_R_TRY(w_bf.Write(this->fimg));
59 Result ValidateImpl(
const std::string &path, std::shared_ptr<fs::FileHandle> file_handle,
const fs::FileCompression comp)
override;
60 Result ReadImpl(
const std::string &path, std::shared_ptr<fs::FileHandle> file_handle,
const fs::FileCompression comp)
override;