本文整理汇总了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;
}
示例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;
}
示例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;
}