本文整理汇总了C++中FileLoader::Path方法的典型用法代码示例。如果您正苦于以下问题:C++ FileLoader::Path方法的具体用法?C++ FileLoader::Path怎么用?C++ FileLoader::Path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileLoader
的用法示例。
在下文中一共展示了FileLoader::Path方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Path
std::string CachingFileLoader::Path() const {
lock_guard guard(backendMutex_);
return backend_->Path();
}
示例2: run
virtual void run() {
if (!info_->LoadFromPath(gamePath_))
return;
std::string filename = gamePath_;
{
lock_guard lock(info_->lock);
info_->fileType = Identify_File(info_->GetFileLoader());
}
switch (info_->fileType) {
case FILETYPE_PSP_PBP:
case FILETYPE_PSP_PBP_DIRECTORY:
{
FileLoader *pbpLoader = info_->GetFileLoader();
std::unique_ptr<FileLoader> altLoader;
if (info_->fileType == FILETYPE_PSP_PBP_DIRECTORY) {
pbpLoader = ConstructFileLoader(pbpLoader->Path() + "/EBOOT.PBP");
altLoader.reset(pbpLoader);
}
PBPReader pbp(pbpLoader);
if (!pbp.IsValid()) {
if (pbp.IsELF()) {
goto handleELF;
}
ERROR_LOG(LOADER, "invalid pbp %s\n", pbpLoader->Path().c_str());
return;
}
// First, PARAM.SFO.
std::vector<u8> sfoData;
if (pbp.GetSubFile(PBP_PARAM_SFO, &sfoData)) {
lock_guard lock(info_->lock);
info_->paramSFO.ReadSFO(sfoData);
info_->ParseParamSFO();
}
// Then, ICON0.PNG.
if (pbp.GetSubFileSize(PBP_ICON0_PNG) > 0) {
lock_guard lock(info_->lock);
pbp.GetSubFileAsString(PBP_ICON0_PNG, &info_->iconTextureData);
} else {
// Read standard icon
DEBUG_LOG(LOADER, "Loading unknown.png because a PBP was missing an icon");
ReadVFSToString("unknown.png", &info_->iconTextureData, &info_->lock);
}
info_->iconDataLoaded = true;
if (info_->wantFlags & GAMEINFO_WANTBG) {
if (pbp.GetSubFileSize(PBP_PIC0_PNG) > 0) {
lock_guard lock(info_->lock);
pbp.GetSubFileAsString(PBP_PIC0_PNG, &info_->pic0TextureData);
info_->pic0DataLoaded = true;
}
if (pbp.GetSubFileSize(PBP_PIC1_PNG) > 0) {
lock_guard lock(info_->lock);
pbp.GetSubFileAsString(PBP_PIC1_PNG, &info_->pic1TextureData);
info_->pic1DataLoaded = true;
}
}
if (info_->wantFlags & GAMEINFO_WANTSND) {
if (pbp.GetSubFileSize(PBP_SND0_AT3) > 0) {
lock_guard lock(info_->lock);
pbp.GetSubFileAsString(PBP_SND0_AT3, &info_->sndFileData);
info_->sndDataLoaded = true;
}
}
}
break;
case FILETYPE_PSP_ELF:
handleELF:
// An elf on its own has no usable information, no icons, no nothing.
{
lock_guard lock(info_->lock);
info_->id = "ELF000000";
info_->id_version = "ELF000000_1.00";
info_->paramSFOLoaded = true;
}
// Read standard icon
DEBUG_LOG(LOADER, "Loading unknown.png because there was an ELF");
ReadVFSToString("unknown.png", &info_->iconTextureData, &info_->lock);
info_->iconDataLoaded = true;
break;
case FILETYPE_PSP_SAVEDATA_DIRECTORY:
{
SequentialHandleAllocator handles;
VirtualDiscFileSystem umd(&handles, gamePath_.c_str());
// Alright, let's fetch the PARAM.SFO.
std::string paramSFOcontents;
if (ReadFileToString(&umd, "/PARAM.SFO", ¶mSFOcontents, 0)) {
lock_guard lock(info_->lock);
info_->paramSFO.ReadSFO((const u8 *)paramSFOcontents.data(), paramSFOcontents.size());
info_->ParseParamSFO();
}
//.........这里部分代码省略.........