Utils: Move CommandLine to fileutils.{cpp,h}

Causes less #include hassle when using downstream instead of
command/argument pairs.

Change-Id: I0fa0d016374df0b8e0a22f3786623652af684d36
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-05-29 19:28:43 +02:00
parent a154f26af5
commit 959fec76dc
6 changed files with 57 additions and 43 deletions

View File

@@ -128,6 +128,29 @@ using FilePathList = QList<FilePath>;
using FileName = FilePath;
using FileNameList = FilePathList;
class QTCREATOR_UTILS_EXPORT CommandLine
{
public:
CommandLine() {}
CommandLine(const FilePath &executable, const QString &arguments)
: m_executable(executable), m_arguments(arguments)
{}
void addArg(const QString &arg);
void addArgs(const QStringList &inArgs);
void addArgs(const QString &inArgs);
QString toUserOutput() const;
FilePath executable() const { return m_executable; }
QString arguments() const { return m_arguments; }
private:
FilePath m_executable;
QString m_arguments;
};
class QTCREATOR_UTILS_EXPORT FileUtils {
public:
static bool removeRecursively(const FilePath &filePath, QString *error = nullptr);