当前位置: 首页>>代码示例>>C++>>正文


C++ FileLoader::Path方法代码示例

本文整理汇总了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();
}
开发者ID:Bigpet,项目名称:ppsspp,代码行数:4,代码来源:Loaders.cpp

示例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", &paramSFOcontents, 0)) {
				lock_guard lock(info_->lock);
				info_->paramSFO.ReadSFO((const u8 *)paramSFOcontents.data(), paramSFOcontents.size());
				info_->ParseParamSFO();
			}

//.........这里部分代码省略.........
开发者ID:BlueSplash,项目名称:ppsspp,代码行数:101,代码来源:GameInfoCache.cpp


注:本文中的FileLoader::Path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。