2021-10-02 14:57:12 +00:00
|
|
|
#pragma once
|
|
|
|
#include <tc/Optional.h>
|
|
|
|
#include <tc/io.h>
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
namespace nstool
|
|
|
|
{
|
|
|
|
|
|
|
|
class FsProcess
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FsProcess();
|
|
|
|
|
2021-10-13 07:41:02 +00:00
|
|
|
void process();
|
|
|
|
|
2021-10-02 14:57:12 +00:00
|
|
|
void setInputFileSystem(const std::shared_ptr<tc::io::IStorage>& input_fs);
|
2021-10-08 10:05:51 +00:00
|
|
|
void setFsFormatName(const std::string& fs_format_name);
|
|
|
|
void setFsProperties(const std::vector<std::string>& properties);
|
|
|
|
void setShowFsInfo(bool show_fs_info);
|
|
|
|
void setShowFsTree(bool show_fs_tree);
|
|
|
|
void setFsRootLabel(const std::string& root_label);
|
|
|
|
void setExtractJobs(const std::vector<nstool::ExtractJob>& extract_jobs);
|
2021-10-02 14:57:12 +00:00
|
|
|
private:
|
|
|
|
std::string mModuleLabel;
|
|
|
|
|
|
|
|
std::shared_ptr<tc::io::IStorage> mInputFs;
|
2021-10-08 10:05:51 +00:00
|
|
|
|
|
|
|
// fs info
|
|
|
|
tc::Optional<std::string> mFsFormatName;
|
|
|
|
bool mShowFsInfo;
|
|
|
|
std::vector<std::string> mProperties;
|
|
|
|
|
|
|
|
// fs tree
|
|
|
|
bool mShowFsTree;
|
|
|
|
tc::Optional<std::string> mFsRootLabel;
|
|
|
|
|
|
|
|
// extract jobs
|
|
|
|
std::vector<nstool::ExtractJob> mExtractJobs;
|
|
|
|
|
|
|
|
// cache for file extract
|
|
|
|
tc::ByteData mDataCache;
|
2021-10-02 14:57:12 +00:00
|
|
|
|
|
|
|
void printFs();
|
|
|
|
void extractFs();
|
|
|
|
|
|
|
|
void visitDir(const tc::io::Path& v_path, const tc::io::Path& l_path, bool extract_fs, bool print_fs);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|