From ea2dd32e32be48a86f52290e80f4157ed1c1ac54 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 26 Feb 2020 17:05:51 +0800 Subject: [PATCH] Update PfsProcess to use PartitionFsUtil --- src/PfsProcess.cpp | 29 +++++++---------------------- src/PfsProcess.h | 2 -- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/PfsProcess.cpp b/src/PfsProcess.cpp index 3661fd1..36287e5 100644 --- a/src/PfsProcess.cpp +++ b/src/PfsProcess.cpp @@ -1,8 +1,13 @@ +#include "PfsProcess.h" + #include #include + #include #include -#include "PfsProcess.h" + +#include + PfsProcess::PfsProcess() : mFile(), @@ -95,7 +100,7 @@ void PfsProcess::importHeader() void PfsProcess::displayHeader() { std::cout << "[PartitionFS]" << std::endl; - std::cout << " Type: " << getFsTypeStr(mPfs.getFsType()) << std::endl; + std::cout << " Type: " << nn::hac::PartitionFsUtil::getFsTypeAsString(mPfs.getFsType()) << std::endl; std::cout << " FileNum: " << std::dec << mPfs.getFileList().size() << std::endl; if (mMountName.empty() == false) { @@ -191,24 +196,4 @@ void PfsProcess::extractFs() } outFile.close(); } -} - -const char* PfsProcess::getFsTypeStr(nn::hac::PartitionFsHeader::FsType type) const -{ - const char* str = nullptr; - - switch (type) - { - case (nn::hac::PartitionFsHeader::TYPE_PFS0): - str = "PFS0"; - break; - case (nn::hac::PartitionFsHeader::TYPE_HFS0): - str = "HFS0"; - break; - default: - str = "Unknown"; - break; - } - - return str; } \ No newline at end of file diff --git a/src/PfsProcess.h b/src/PfsProcess.h index d49ba9a..8ae6fd7 100644 --- a/src/PfsProcess.h +++ b/src/PfsProcess.h @@ -50,6 +50,4 @@ private: bool validateHeaderMagic(const nn::hac::sPfsHeader* hdr); void validateHfs(); void extractFs(); - - const char* getFsTypeStr(nn::hac::PartitionFsHeader::FsType type) const; }; \ No newline at end of file