44 lines
706 B
C++
44 lines
706 B
C++
#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);
|
|
}
|
|
}
|