Commit 6c55755b authored by Sebastian Holtermann's avatar Sebastian Holtermann

Autogen: Generators: Make class static method a source static function

parent 1491ab1c
Pipeline #42451 passed with stage
......@@ -97,6 +97,25 @@ static bool ListContains(const std::vector<std::string>& list,
return (std::find(list.begin(), list.end(), entry) != list.end());
}
static std::string JoinExts(const std::vector<std::string>& lst)
{
if (lst.empty()) {
return "";
}
std::string result;
std::string separator = ",";
for (std::vector<std::string>::const_iterator it = lst.begin();
it != lst.end(); ++it) {
if (it != lst.begin()) {
result += separator;
}
result += '.' + (*it);
}
result.erase(result.end() - 1);
return result;
}
static void UicMergeOptions(std::vector<std::string>& opts,
const std::vector<std::string>& fileOpts,
bool isQt5)
......@@ -749,7 +768,7 @@ bool cmQtAutoGenerators::ParseContentForMoc(
err << "AutoMoc: Error: " << absFilename << "\n"
<< "The file includes the moc file \"" << currentMoc
<< "\", but could not find header \"" << basename << '{'
<< this->JoinExts(headerExtensions) << "}\" ";
<< JoinExts(headerExtensions) << "}\" ";
if (mocSubDir.empty()) {
err << "in " << scannedFileAbsPath << "\n";
} else {
......@@ -1509,22 +1528,3 @@ bool cmQtAutoGenerators::MakeParentDirectory(const std::string& filename)
}
return success;
}
std::string cmQtAutoGenerators::JoinExts(const std::vector<std::string>& lst)
{
if (lst.empty()) {
return "";
}
std::string result;
std::string separator = ",";
for (std::vector<std::string>::const_iterator it = lst.begin();
it != lst.end(); ++it) {
if (it != lst.begin()) {
result += separator;
}
result += '.' + (*it);
}
result.erase(result.end() - 1);
return result;
}
......@@ -106,7 +106,6 @@ private:
bool NameCollisionTest(const std::map<std::string, std::string>& genFiles,
std::multimap<std::string, std::string>& collisions);
bool MakeParentDirectory(const std::string& filename);
static std::string JoinExts(const std::vector<std::string>& lst);
// - Target names
std::string OriginTargetName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment