mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 20:46:37 +08:00
Autogen: Protected calls to cmSystemTools::Split/JoinPath
This commit is contained in:
@@ -160,6 +160,29 @@ std::string cmQtAutoGenerator::FileSystem::CollapseCombinedPath(
|
|||||||
return cmSystemTools::CollapseCombinedPath(dir, file);
|
return cmSystemTools::CollapseCombinedPath(dir, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmQtAutoGenerator::FileSystem::SplitPath(
|
||||||
|
const std::string& p, std::vector<std::string>& components,
|
||||||
|
bool expand_home_dir)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(Mutex_);
|
||||||
|
cmSystemTools::SplitPath(p, components, expand_home_dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string cmQtAutoGenerator::FileSystem::JoinPath(
|
||||||
|
const std::vector<std::string>& components)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(Mutex_);
|
||||||
|
return cmSystemTools::JoinPath(components);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string cmQtAutoGenerator::FileSystem::JoinPath(
|
||||||
|
std::vector<std::string>::const_iterator first,
|
||||||
|
std::vector<std::string>::const_iterator last)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(Mutex_);
|
||||||
|
return cmSystemTools::JoinPath(first, last);
|
||||||
|
}
|
||||||
|
|
||||||
bool cmQtAutoGenerator::FileSystem::FileExists(std::string const& filename)
|
bool cmQtAutoGenerator::FileSystem::FileExists(std::string const& filename)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(Mutex_);
|
std::lock_guard<std::mutex> lock(Mutex_);
|
||||||
|
@@ -77,6 +77,14 @@ public:
|
|||||||
/// @brief Wrapper for cmSystemTools::CollapseCombinedPath
|
/// @brief Wrapper for cmSystemTools::CollapseCombinedPath
|
||||||
std::string CollapseCombinedPath(std::string const& dir,
|
std::string CollapseCombinedPath(std::string const& dir,
|
||||||
std::string const& file);
|
std::string const& file);
|
||||||
|
/// @brief Wrapper for cmSystemTools::SplitPath
|
||||||
|
void SplitPath(const std::string& p, std::vector<std::string>& components,
|
||||||
|
bool expand_home_dir = true);
|
||||||
|
/// @brief Wrapper for cmSystemTools::JoinPath
|
||||||
|
std::string JoinPath(const std::vector<std::string>& components);
|
||||||
|
/// @brief Wrapper for cmSystemTools::JoinPath
|
||||||
|
std::string JoinPath(std::vector<std::string>::const_iterator first,
|
||||||
|
std::vector<std::string>::const_iterator last);
|
||||||
|
|
||||||
// -- File access
|
// -- File access
|
||||||
bool FileExists(std::string const& filename);
|
bool FileExists(std::string const& filename);
|
||||||
|
@@ -1503,8 +1503,8 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
|
|||||||
if (cmHasLiteralSuffix(path, ".framework/Headers")) {
|
if (cmHasLiteralSuffix(path, ".framework/Headers")) {
|
||||||
// Go up twice to get to the framework root
|
// Go up twice to get to the framework root
|
||||||
std::vector<std::string> pathComponents;
|
std::vector<std::string> pathComponents;
|
||||||
cmSystemTools::SplitPath(path, pathComponents);
|
FileSys().SplitPath(path, pathComponents);
|
||||||
std::string frameworkPath = cmSystemTools::JoinPath(
|
std::string frameworkPath = FileSys().JoinPath(
|
||||||
pathComponents.begin(), pathComponents.end() - 2);
|
pathComponents.begin(), pathComponents.end() - 2);
|
||||||
frameworkPaths.insert(frameworkPath);
|
frameworkPaths.insert(frameworkPath);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user