本文整理汇总了C++中FileLoader::IsDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ FileLoader::IsDirectory方法的具体用法?C++ FileLoader::IsDirectory怎么用?C++ FileLoader::IsDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileLoader
的用法示例。
在下文中一共展示了FileLoader::IsDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsDirectory
bool CachingFileLoader::IsDirectory() {
if (isDirectory_ == -1) {
lock_guard guard(backendMutex_);
isDirectory_ = backend_->IsDirectory() ? 1 : 0;
}
return isDirectory_ == 1;
}
示例2: __UmdReplace
void __UmdReplace(std::string filepath) {
// TODO: This should really go through Loaders, no? What if it's an invalid file?
// Only get system from disc0 seems have been enough.
IFileSystem* currentUMD = pspFileSystem.GetSystem("disc0:");
IFileSystem* currentISOBlock = pspFileSystem.GetSystem("umd0:");
if (!currentUMD)
return;
FileLoader *loadedFile = ConstructFileLoader(filepath);
IFileSystem* umd2;
if (!loadedFile->Exists()) {
delete loadedFile;
return;
}
UpdateLoadedFile(loadedFile);
if (loadedFile->IsDirectory()) {
umd2 = new VirtualDiscFileSystem(&pspFileSystem, filepath);
} else {
auto bd = constructBlockDevice(loadedFile);
if (!bd)
return;
umd2 = new ISOFileSystem(&pspFileSystem, bd);
pspFileSystem.Remount(currentUMD, umd2);
if (currentUMD != currentISOBlock) {
// We mounted an ISO block system separately.
IFileSystem *iso = new ISOBlockSystem(static_cast<ISOFileSystem *>(umd2));
pspFileSystem.Remount(currentISOBlock, iso);
delete currentISOBlock;
}
}
delete currentUMD;
// TODO Is this always correct if UMD was not activated?
u32 notifyArg = PSP_UMD_PRESENT | PSP_UMD_READABLE | PSP_UMD_CHANGED;
if (driveCBId != -1)
__KernelNotifyCallback(driveCBId, notifyArg);
}