本文整理汇总了C++中FileSystem::Exists方法的典型用法代码示例。如果您正苦于以下问题:C++ FileSystem::Exists方法的具体用法?C++ FileSystem::Exists怎么用?C++ FileSystem::Exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSystem
的用法示例。
在下文中一共展示了FileSystem::Exists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindStyle
void WebUIServer::FindStyle()
{
styleRoot_.clear();
const std::string style = System::GetSettings()->webui.style;
std::set<std::string> paths;
paths.insert(System::Home());
paths.insert("/usr/local/share/sharelin");
paths.insert("/usr/share/sharelin");
paths.insert(root_directory);
#ifdef DEFAULT_ROOT
paths.insert(std::string(DEFAULT_ROOT) + "/share/sharelin");
#endif
for(std::set<std::string>::iterator i = paths.begin(); i != paths.end(); ++i)
{
const std::string s = *i + "/webui/" + style;
System::LogBas() << "Searching style '" << style << "' in " << s << " => ";
if(Exists(s))
{
styleRoot_ = s;
System::Log() << "Found" << std::endl;
//__android_log_write(ANDROID_LOG_DEBUG, "sharelin", "Found");
break;
}
else System::Log() << "Not found" << std::endl;
//__android_log_write(ANDROID_LOG_DEBUG, "sharelin", "Not found");
}
}
示例2: HandleFileChanged
void AssetDatabase::HandleFileChanged(StringHash eventType, VariantMap& eventData)
{
using namespace FileChanged;
const String& fullPath = eventData[P_FILENAME].GetString();
FileSystem* fs = GetSubsystem<FileSystem>();
String pathName, fileName, ext;
SplitPath(fullPath, pathName, fileName, ext);
// ignore changes in the Cache resource dir
if (fullPath == GetCachePath() || pathName.StartsWith(GetCachePath()))
return;
// don't care about directories and asset file changes
if (fs->DirExists(fullPath) || ext == ".asset")
return;
Asset* asset = GetAssetByPath(fullPath);
if (!asset && fs->FileExists(fullPath))
{
Scan();
return;
}
if (asset)
{
if(!fs->Exists(fullPath))
{
DeleteAsset(asset);
}
else
{
if (asset->GetFileTimestamp() != fs->GetLastModifiedTime(asset->GetPath()))
{
asset->SetDirty(true);
Scan();
}
}
}
}