diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-04-18 09:39:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-04-19 16:48:05 (GMT) |
commit | 95064a6d35c93557c9bb87bc8eeff8555d7295a2 (patch) | |
tree | e94731508f136b3df4cd705ae9dadb53dbddccae /Source/cmQtAutoGenerators.cxx | |
parent | 7a73c404dd63aef0e68da9ef70ac706a6339c476 (diff) | |
download | CMake-95064a6d35c93557c9bb87bc8eeff8555d7295a2.zip CMake-95064a6d35c93557c9bb87bc8eeff8555d7295a2.tar.gz CMake-95064a6d35c93557c9bb87bc8eeff8555d7295a2.tar.bz2 |
Autogen: Rename header extension Join method to JoinExts
While at it, simplify the signature and avoid a trailing separator.
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index ee40e7a..19f6a38 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -762,7 +762,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename, std::cerr << "AUTOGEN: error: " << absFilename << ": The file " << "includes the moc file \"" << currentMoc << "\", " << "but could not find header \"" << basename - << '{' << this->Join(headerExtensions, ',') << "}\" "; + << '{' << this->JoinExts(headerExtensions) << "}\" "; if (mocSubDir.empty()) { std::cerr << "in " << absPath << "\n" << std::endl; @@ -937,7 +937,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename, std::cerr << "AUTOGEN: error: " << absFilename << " The file " << "includes the moc file \"" << currentMoc << "\", " << "but could not find header \"" << basename - << '{' << this->Join(headerExtensions, ',') << "}\" "; + << '{' << this->JoinExts(headerExtensions) << "}\" "; if (mocSubDir.empty()) { std::cerr << "in " << absPath << "\n" << std::endl; @@ -1347,8 +1347,7 @@ bool cmQtAutoGenerators::GenerateQrc() return true; } -std::string cmQtAutoGenerators::Join(const std::vector<std::string>& lst, - char separator) +std::string cmQtAutoGenerators::JoinExts(const std::vector<std::string>& lst) { if (lst.empty()) { @@ -1356,11 +1355,16 @@ std::string cmQtAutoGenerators::Join(const std::vector<std::string>& lst, } std::string result; + std::string separator = ","; for (std::vector<std::string>::const_iterator it = lst.begin(); it != lst.end(); ++it) { - result += "." + (*it) + separator; + if(it != lst.begin()) + { + result += separator; + } + result += '.' + (*it); } result.erase(result.end() - 1); return result; |