nstool/src/PfsProcess.h

48 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include "types.h"
#include "FsProcess.h"
2022-06-29 13:19:36 +00:00
#include <pietendo/hac/PartitionFsHeader.h>
namespace nstool {
class PfsProcess
{
public:
PfsProcess();
2021-10-13 07:41:02 +00:00
void process();
// generic
void setInputFile(const std::shared_ptr<tc::io::IStream>& file);
void setCliOutputMode(CliOutputMode type);
void setVerifyMode(bool verify);
// fs specific
void setShowFsTree(bool show_fs_tree);
void setFsRootLabel(const std::string& root_label);
void setExtractJobs(const std::vector<nstool::ExtractJob>& extract_jobs);
// post process() get PFS/FS out
2022-06-29 13:19:36 +00:00
const pie::hac::PartitionFsHeader& getPfsHeader() const;
const std::shared_ptr<tc::io::IFileSystem>& getFileSystem() const;
private:
static const size_t kCacheSize = 0x10000;
2021-10-02 14:53:21 +00:00
std::string mModuleName;
std::shared_ptr<tc::io::IStream> mFile;
CliOutputMode mCliOutputMode;
bool mVerify;
2022-06-29 13:19:36 +00:00
pie::hac::PartitionFsHeader mPfs;
2022-06-29 13:19:36 +00:00
std::shared_ptr<tc::io::IFileSystem> mFileSystem;
FsProcess mFsProcess;
2022-06-29 13:19:36 +00:00
size_t determineHeaderSize(const pie::hac::sPfsHeader* hdr);
bool validateHeaderMagic(const pie::hac::sPfsHeader* hdr);
};
}