39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "libNPK.h"
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
|
|
namespace NPK
|
|
{
|
|
class NPKFileList : public IFileList
|
|
{
|
|
public:
|
|
|
|
public:
|
|
virtual bool loadListFromFile(const wchar_t* wszListFile, const char* prefix,
|
|
bool bNpkBase, bool bNpkName, bool bFileOffset, bool bFileSize, bool bFileCRC,
|
|
bool bEnableDuplicate) override;
|
|
virtual bool dumpToLocalFile(const wchar_t* wszListFile,
|
|
bool bNpkBase, bool bNpkName, bool bFileOffset, bool bFileSize, bool bFileCRC);
|
|
virtual bool mergeOtherListInto(const IFileList* sourceFileList, bool bEnableDuplicate) override;
|
|
virtual bool applyToLocalNPKFiles(const wchar_t* wszNPKBase) override;
|
|
|
|
virtual int32_t getFileCounts(void) const override;
|
|
virtual bool getFileItem(int32_t index, FileItemFullInfo* fullInfo) const override;
|
|
virtual bool getFileItem(const char* szKeyName, FileItemFullInfo* fileItemFullInfo) const override;
|
|
|
|
public:
|
|
bool addFileNode(const FileItemFullInfo& fullInfo, bool bEnableDuplicate);
|
|
|
|
private:
|
|
void clear();
|
|
std::wstring getNPKPathNameFromKeyName(const wchar_t* wszNPKBase, const char* keyName);
|
|
|
|
private:
|
|
std::vector<FileItemFullInfo> m_fileList;
|
|
std::unordered_map<std::string, std::vector<FileItemFullInfo>::size_type> m_hashList;
|
|
};
|
|
|
|
}
|