2019-01-31 09:10:19 +00:00
|
|
|
#pragma once
|
2021-09-28 11:15:54 +00:00
|
|
|
#include "types.h"
|
2021-10-03 02:47:11 +00:00
|
|
|
#include "FsProcess.h"
|
2021-09-28 11:15:54 +00:00
|
|
|
|
2019-01-31 09:10:19 +00:00
|
|
|
#include <nn/hac/define/romfs.h>
|
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
namespace nstool {
|
2019-01-31 09:10:19 +00:00
|
|
|
|
|
|
|
class RomfsProcess
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RomfsProcess();
|
|
|
|
|
|
|
|
// generic
|
2021-09-28 11:15:54 +00:00
|
|
|
void setInputFile(const std::shared_ptr<tc::io::IStream>& file);
|
2019-01-31 09:10:19 +00:00
|
|
|
void setCliOutputMode(CliOutputMode type);
|
|
|
|
void setVerifyMode(bool verify);
|
|
|
|
|
2021-10-08 10:05:51 +00:00
|
|
|
// fs specific
|
|
|
|
void setFsRootLabel(const std::string& root_label);
|
|
|
|
void setExtractJobs(const std::vector<nstool::ExtractJob>& extract_jobs);
|
|
|
|
void setShowFsTree(bool show_fs_tree);
|
2021-10-03 02:47:11 +00:00
|
|
|
|
2021-10-08 10:05:51 +00:00
|
|
|
void process();
|
2019-01-31 09:10:19 +00:00
|
|
|
private:
|
|
|
|
static const size_t kCacheSize = 0x10000;
|
|
|
|
|
2021-10-03 02:47:11 +00:00
|
|
|
std::string mModuleName;
|
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
std::shared_ptr<tc::io::IStream> mFile;
|
2019-01-31 09:10:19 +00:00
|
|
|
CliOutputMode mCliOutputMode;
|
|
|
|
bool mVerify;
|
|
|
|
|
2021-10-03 02:47:11 +00:00
|
|
|
nn::hac::sRomfsHeader mRomfsHeader;
|
2019-01-31 09:10:19 +00:00
|
|
|
size_t mDirNum;
|
|
|
|
size_t mFileNum;
|
|
|
|
|
2021-10-03 02:47:11 +00:00
|
|
|
std::shared_ptr<tc::io::IStorage> mFileSystem;
|
|
|
|
FsProcess mFsProcess;
|
2021-09-28 11:15:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|