本文整理汇总了C++中ogre::FileInfoListPtr::at方法的典型用法代码示例。如果您正苦于以下问题:C++ FileInfoListPtr::at方法的具体用法?C++ FileInfoListPtr::at怎么用?C++ FileInfoListPtr::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::FileInfoListPtr
的用法示例。
在下文中一共展示了FileInfoListPtr::at方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAssetPath
String ResourceManager::GetAssetPath(const String& FileName, const String& Group)
{
Ogre::FileInfoListPtr FileList = this->OgreResource->listResourceFileInfo(Group);
for( Whole X = 0 ; X < FileList->size() ; ++X )
{
if( FileName == FileList->at(X).filename )
{
return FileList->at(X).path;
}
}
return "";
}
示例2: open
//-----------------------------------------------------------------------
DataStreamPtr ZipArchive::open(const String& filename, bool readOnly)
{
// zziplib is not threadsafe
OGRE_LOCK_AUTO_MUTEX;
String lookUpFileName = filename;
// Format not used here (always binary)
ZZIP_FILE* zzipFile =
zzip_file_open(mZzipDir, lookUpFileName.c_str(), ZZIP_ONLYZIP | ZZIP_CASELESS);
if (!zzipFile) // Try if we find the file
{
const Ogre::FileInfoListPtr fileNfo = findFileInfo(lookUpFileName, true);
if (fileNfo->size() == 1) // If there are more files with the same do not open anyone
{
Ogre::FileInfo info = fileNfo->at(0);
lookUpFileName = info.path + info.basename;
zzipFile = zzip_file_open(mZzipDir, lookUpFileName.c_str(), ZZIP_ONLYZIP | ZZIP_CASELESS); // When an error happens here we will catch it below
}
}
if (!zzipFile)
{
int zerr = zzip_error(mZzipDir);
String zzDesc = getZzipErrorDescription((zzip_error_t)zerr);
LogManager::getSingleton().logMessage(
mName + " - Unable to open file " + lookUpFileName + ", error was '" + zzDesc + "'", LML_CRITICAL);
// return null pointer
return DataStreamPtr();
}
// Get uncompressed size too
ZZIP_STAT zstat;
zzip_dir_stat(mZzipDir, lookUpFileName.c_str(), &zstat, ZZIP_CASEINSENSITIVE);
// Construct & return stream
return DataStreamPtr(OGRE_NEW ZipDataStream(lookUpFileName, zzipFile, static_cast<size_t>(zstat.st_size)));
}