增加Lua导出和FileList

This commit is contained in:
2025-09-02 20:39:30 +08:00
parent 1fb319f0e8
commit 6788128cc3
18 changed files with 682 additions and 56 deletions
+43
View File
@@ -0,0 +1,43 @@
#include "libNPK_FileList.h"
namespace NPK
{
int32_t NPKFileList::getFileCounts(void) const
{
return (int32_t)m_fileList.size();
}
bool NPKFileList::getFileItem(int32_t index, FileItemFullInfo* fullInfo) const
{
if(index< 0 || index >= getFileCounts())
{
return false;
}
*fullInfo = m_fileList[index];
return true;
}
void NPKFileList::addFileNode(const FileItemFullInfo& fullInfo)
{
//TODO: check duplicate file name?
m_fileList.push_back(fullInfo);
}
void NPKFileList::mergeOtherListInto(const IFileList* source)
{
}
IFileList* createEmptyFileList()
{
return new NPKFileList();
}
// destroy a file list
void destoryFileList(IFileList* fileList)
{
delete ((NPKFileList*)fileList);
}
}