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


C++ FileSpec::GetFileNameExtension方法代码示例

本文整理汇总了C++中FileSpec::GetFileNameExtension方法的典型用法代码示例。如果您正苦于以下问题:C++ FileSpec::GetFileNameExtension方法的具体用法?C++ FileSpec::GetFileNameExtension怎么用?C++ FileSpec::GetFileNameExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileSpec的用法示例。


在下文中一共展示了FileSpec::GetFileNameExtension方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sle_kext_directory_path

FileSpec::EnumerateDirectoryResult
PlatformDarwinKernel::GetKextDirectoriesInSDK (void *baton,
                                               FileSpec::FileType file_type,
                                               const FileSpec &file_spec)
{
    if (file_type == FileSpec::eFileTypeDirectory 
        && (file_spec.GetFileNameExtension() == ConstString("sdk")
            || file_spec.GetFileNameExtension() == ConstString("kdk")))
    {
        std::string kext_directory_path = file_spec.GetPath();

        // Append the raw directory path, e.g. /Library/Developer/KDKs/KDK_10.10_14A298i.kdk
        // to the directory search list -- there may be kexts sitting directly
        // in that directory instead of being in a System/Library/Extensions subdir.
        ((std::vector<lldb_private::FileSpec> *)baton)->push_back(file_spec);

        // Check to see if there is a System/Library/Extensions subdir & add it if it exists

        std::string sle_kext_directory_path (kext_directory_path);
        sle_kext_directory_path.append ("/System/Library/Extensions");
        FileSpec sle_kext_directory (sle_kext_directory_path.c_str(), true);
        if (sle_kext_directory.Exists() && sle_kext_directory.IsDirectory())
        {
            ((std::vector<lldb_private::FileSpec> *)baton)->push_back(sle_kext_directory);
        }

        // Check to see if there is a Library/Extensions subdir & add it if it exists

        std::string le_kext_directory_path (kext_directory_path);
        le_kext_directory_path.append ("/Library/Extensions");
        FileSpec le_kext_directory (le_kext_directory_path.c_str(), true);
        if (le_kext_directory.Exists() && le_kext_directory.IsDirectory())
        {
            ((std::vector<lldb_private::FileSpec> *)baton)->push_back(le_kext_directory);
        }

        // Check to see if there is a System/Library/Kernels subdir & add it if it exists
        std::string slk_kernel_path (kext_directory_path);
        slk_kernel_path.append ("/System/Library/Kernels");
        FileSpec slk_kernel_directory (slk_kernel_path.c_str(), true);
        if (slk_kernel_directory.Exists() && slk_kernel_directory.IsDirectory())
        {
            ((std::vector<lldb_private::FileSpec> *)baton)->push_back(slk_kernel_directory);
        }

        // Check to see if there is a System/Library/Extensions/KDK subdir & add it if it exists
        std::string slek_kernel_path (kext_directory_path);
        slek_kernel_path.append ("/System/Library/Extensions/KDK");
        FileSpec slek_kernel_directory (slek_kernel_path.c_str(), true);
        if (slek_kernel_directory.Exists() && slek_kernel_directory.IsDirectory())
        {
            ((std::vector<lldb_private::FileSpec> *)baton)->push_back(slek_kernel_directory);
        }
    }
    return FileSpec::eEnumerateDirectoryResultNext;
}
开发者ID:CTSRD-CHERI,项目名称:lldb,代码行数:56,代码来源:PlatformDarwinKernel.cpp

示例2: kext_directory

FileSpec::EnumerateDirectoryResult
PlatformDarwinKernel::GetKextDirectoriesInSDK (void *baton,
                                               FileSpec::FileType file_type,
                                               const FileSpec &file_spec)
{
    if (file_type == FileSpec::eFileTypeDirectory 
        && (file_spec.GetFileNameExtension() == ConstString("sdk")
            || file_spec.GetFileNameExtension() == ConstString("kdk")))
    {
        std::string kext_directory_path = file_spec.GetPath();
        kext_directory_path.append ("/System/Library/Extensions");
        FileSpec kext_directory (kext_directory_path.c_str(), true);
        if (kext_directory.Exists() && kext_directory.IsDirectory())
        {
            ((std::vector<lldb_private::FileSpec> *)baton)->push_back(kext_directory);
        }
    }
    return FileSpec::eEnumerateDirectoryResultNext;
}
开发者ID:Rutuja15,项目名称:lldb-310.2.36,代码行数:19,代码来源:PlatformDarwinKernel.cpp

示例3: contents_plugins

FileSpec::EnumerateDirectoryResult
PlatformDarwinKernel::GetKextsInDirectory (void *baton,
                                           FileSpec::FileType file_type,
                                           const FileSpec &file_spec)
{
    if (file_type == FileSpec::eFileTypeDirectory && file_spec.GetFileNameExtension() == ConstString("kext"))
    {
        ((std::vector<lldb_private::FileSpec> *)baton)->push_back(file_spec);
        std::string kext_bundle_path = file_spec.GetPath();
        std::string search_here_too;
        std::string contents_plugins_path = kext_bundle_path + "/Contents/PlugIns";
        FileSpec contents_plugins (contents_plugins_path.c_str(), false);
        if (contents_plugins.Exists() && contents_plugins.IsDirectory())
        {
            search_here_too = contents_plugins_path;
        }
        else
        {
            std::string plugins_path = kext_bundle_path + "/PlugIns";
            FileSpec plugins (plugins_path.c_str(), false);
            if (plugins.Exists() && plugins.IsDirectory())
            {
                search_here_too = plugins_path;
            }
        }

        if (!search_here_too.empty())
        {
            const bool find_directories = true;
            const bool find_files = false;
            const bool find_other = false;
            FileSpec::EnumerateDirectory (search_here_too.c_str(),
                                          find_directories,
                                          find_files,
                                          find_other,
                                          GetKextsInDirectory,
                                          baton);
        }
    }
    return FileSpec::eEnumerateDirectoryResultNext;
}
开发者ID:Rutuja15,项目名称:lldb-310.2.36,代码行数:41,代码来源:PlatformDarwinKernel.cpp


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