Autogen: Use SystemTools string functions instead of rolling out own
This commit is contained in:
parent
fa4ae9fb12
commit
7a73c404dd
|
@ -464,7 +464,7 @@ void cmQtAutoGenerators::Init()
|
||||||
std::list<std::string>::iterator it = this->MocIncludes.begin();
|
std::list<std::string>::iterator it = this->MocIncludes.begin();
|
||||||
while (it != this->MocIncludes.end())
|
while (it != this->MocIncludes.end())
|
||||||
{
|
{
|
||||||
if (this->StartsWith(*it, binDir))
|
if (cmsys::SystemTools::StringStartsWith(*it, binDir.c_str()))
|
||||||
{
|
{
|
||||||
sortedMocIncludes.push_back(*it);
|
sortedMocIncludes.push_back(*it);
|
||||||
it = this->MocIncludes.erase(it);
|
it = this->MocIncludes.erase(it);
|
||||||
|
@ -477,7 +477,7 @@ void cmQtAutoGenerators::Init()
|
||||||
it = this->MocIncludes.begin();
|
it = this->MocIncludes.begin();
|
||||||
while (it != this->MocIncludes.end())
|
while (it != this->MocIncludes.end())
|
||||||
{
|
{
|
||||||
if (this->StartsWith(*it, srcDir))
|
if (cmsys::SystemTools::StringStartsWith(*it, srcDir.c_str()))
|
||||||
{
|
{
|
||||||
sortedMocIncludes.push_back(*it);
|
sortedMocIncludes.push_back(*it);
|
||||||
it = this->MocIncludes.erase(it);
|
it = this->MocIncludes.erase(it);
|
||||||
|
@ -1365,21 +1365,3 @@ std::string cmQtAutoGenerators::Join(const std::vector<std::string>& lst,
|
||||||
result.erase(result.end() - 1);
|
result.erase(result.end() - 1);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool cmQtAutoGenerators::StartsWith(const std::string& str,
|
|
||||||
const std::string& with)
|
|
||||||
{
|
|
||||||
return (str.substr(0, with.length()) == with);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool cmQtAutoGenerators::EndsWith(const std::string& str,
|
|
||||||
const std::string& with)
|
|
||||||
{
|
|
||||||
if (with.length() > (str.length()))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return (str.substr(str.length() - with.length(), with.length()) == with);
|
|
||||||
}
|
|
||||||
|
|
|
@ -70,8 +70,6 @@ private:
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
std::string Join(const std::vector<std::string>& lst, char separator);
|
std::string Join(const std::vector<std::string>& lst, char separator);
|
||||||
bool EndsWith(const std::string& str, const std::string& with);
|
|
||||||
bool StartsWith(const std::string& str, const std::string& with);
|
|
||||||
|
|
||||||
static void MergeUicOptions(std::vector<std::string> &opts,
|
static void MergeUicOptions(std::vector<std::string> &opts,
|
||||||
const std::vector<std::string> &fileOpts, bool isQt5);
|
const std::vector<std::string> &fileOpts, bool isQt5);
|
||||||
|
|
Loading…
Reference in New Issue