aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/fileutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/utils/fileutils.cpp')
-rw-r--r--src/libs/utils/fileutils.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp
index acf9c6190d..22fb05240b 100644
--- a/src/libs/utils/fileutils.cpp
+++ b/src/libs/utils/fileutils.cpp
@@ -74,6 +74,23 @@ namespace Utils {
*/
+CommandLine::CommandLine(const FilePath &executable)
+ : m_executable(executable)
+{}
+
+CommandLine::CommandLine(const FilePath &exe, const QStringList &args, MetaCharMode metaCharMode)
+ : m_executable(exe)
+ , m_metaCharMode(metaCharMode)
+{
+ addArgs(args);
+}
+
+CommandLine::CommandLine(const FilePath &exe, const QString &args, RawType)
+ : m_executable(exe)
+{
+ addArgs(args, Raw);
+}
+
void CommandLine::addArg(const QString &arg, OsType osType)
{
QtcProcess::addArg(&m_arguments, arg, osType);
@@ -85,7 +102,7 @@ void CommandLine::addArgs(const QStringList &inArgs, OsType osType)
addArg(arg, osType);
}
-void CommandLine::addArgs(const QString &inArgs)
+void CommandLine::addArgs(const QString &inArgs, RawType)
{
QtcProcess::addArgs(&m_arguments, inArgs);
}
@@ -95,6 +112,11 @@ QString CommandLine::toUserOutput() const
return m_executable.toUserOutput() + ' ' + m_arguments;
}
+QStringList CommandLine::splitArguments(OsType osType) const
+{
+ return QtcProcess::splitArgs(m_arguments, osType);
+}
+
/*! \class Utils::FileUtils
\brief The FileUtils class contains file and directory related convenience