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


C++ FileSystem::Exists方法代码示例

本文整理汇总了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");
    }
}
开发者ID:Toxic-Lab,项目名称:DroidG2,代码行数:27,代码来源:webuiserver.cpp

示例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();
            }
        }
    }
}
开发者ID:nonconforme,项目名称:AtomicGameEngine,代码行数:43,代码来源:AssetDatabase.cpp


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