OSDN Git Service

add Utils::QtcProcess
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Thu, 14 Oct 2010 16:05:43 +0000 (18:05 +0200)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Wed, 17 Nov 2010 12:19:07 +0000 (13:19 +0100)
commit531c70f05bfc8355f856f2af41be533fb13b85e6
tree33d0d30107949f92e507e26f083d5d3caa98e8b8
parentdc3ab5bf85d6ce9be2131f1a299731288d37c923
add Utils::QtcProcess

this is a wrapper around QProcess with these features:
- setEnvironment() takes a Utils::Environment instead of a QStringList
- instead of taking a stringlist with arguments, take a single shell
  command string which is fully compatible with the system's native
  shell (the bourne shell on unix and cmd.exe on windows) - with support
  for environment variable expansion, and subject to the shell's
  splitting and quoting rules. if the command is too complex (e.g.,
  contains redirections), it is transparently executed through a real
  shell.
- additionally, the class contains a set of helper functions for
  manipulating (constructing, splitting, etc.) shell command lines.
  in particular, it contains a shell-safe macro expander and the nested
  class ArgIterator which can be used for inspecting and manipulating a
  shell command line without going through the stringlist indirection
  (which is potentially lossy).

some of this is based on KDE code (KShell and KMacroExpander) which i
have written myself.
src/libs/utils/qtcprocess.cpp [new file with mode: 0644]
src/libs/utils/qtcprocess.h [new file with mode: 0644]
src/libs/utils/utils-lib.pri
tests/auto/auto.pro
tests/auto/qtcprocess/qtcprocess.pro [new file with mode: 0644]
tests/auto/qtcprocess/tst_qtcprocess.cpp [new file with mode: 0644]