blob: f53fc6ba82ecb9ed76099876b0d81b6d385bfc42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef PROFILEUTILS_H
#define PROFILEUTILS_H
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>
#include <algorithm>
using namespace Qt::Literals::StringLiterals;
inline bool isProOrPriFile(const QString &filePath)
{
return filePath.endsWith(".pro"_L1, Qt::CaseInsensitive)
|| filePath.endsWith(".pri"_L1, Qt::CaseInsensitive);
}
inline QStringList extractProFiles(QStringList *files)
{
QStringList result;
auto it = std::remove_if(files->begin(), files->end(), &isProOrPriFile);
if (it == files->end())
return result;
std::move(it, files->end(), std::back_inserter(result));
files->erase(it, files->end());
return result;
}
#endif // PROFILEUTILS_H
|