64,680
社区成员
发帖
与我相关
我的任务
分享
void LizArchive::load()
{
SAFE_DELETE_LIZ(mLizDir);
mLizDir = OGRE_NEW Liz::CLiz_dir();
if (!mLizDir->open(mName.c_str()))
{
SAFE_DELETE_LIZ(mLizDir);
OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, mName + " - error whilst " + ": " + "Can not open",
"ZipArchive::checkZzipError");
}
Liz::LizFileInfo lizEntity;
while (mLizDir->readDir(&lizEntity))
{
Ogre::FileInfo info;
info.archive = this;
// Get basename / path
StringUtil::splitFilename(lizEntity.filename, info.basename, info.path);
info.filename = lizEntity.filename;
// Get sizes
info.compressedSize = lizEntity.compresssize;
info.uncompressedSize = lizEntity.compresssize;
if (info.basename.empty())
{
info.filename = info.filename.substr (0, info.filename.length () - 1);
StringUtil::splitFilename(info.filename, info.basename, info.path);
// Set compressed size to -1 for folders; anyway nobody will check
// the compressed size of a folder, and if he does, its useless anyway
info.compressedSize = size_t (-1);
}
mFileList.push_back(info);
}
}