Update PfsProcess to use PartitionFsUtil

This commit is contained in:
Jack 2020-02-26 17:05:51 +08:00
parent 9c7df06712
commit ea2dd32e32
2 changed files with 7 additions and 24 deletions

View file

@ -1,8 +1,13 @@
#include "PfsProcess.h"
#include <iostream>
#include <iomanip>
#include <fnd/SimpleFile.h>
#include <fnd/io.h>
#include "PfsProcess.h"
#include <nn/hac/PartitionFsUtil.h>
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;
}

View file

@ -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;
};