nstool/src/RomfsProcess.h

42 lines
833 B
C
Raw Normal View History

2019-01-31 09:10:19 +00:00
#pragma once
#include "types.h"
2021-10-03 02:47:11 +00:00
#include "FsProcess.h"
2019-01-31 09:10:19 +00:00
#include <nn/hac/define/romfs.h>
namespace nstool {
2019-01-31 09:10:19 +00:00
class RomfsProcess
{
public:
RomfsProcess();
// generic
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);
// 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
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;
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;
};
}