Debian Codegraph @

lib/ShellCommand.h

raw symbols SCIP
1 /*
2 Copyright (C) 2007 by Robert Knight <[email protected]>
3
4 Rewritten for QT4 by e_k <e_k at users.sourceforge.net>, Copyright (C)2008
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
20 */
21
22 #ifndef SHELLCOMMAND_H
23 #define SHELLCOMMAND_Hcxx . . $ `lib/ShellCommand.h:23:9`!
24
25 // Qt
26 #include <QStringList>
27
28 namespace Konsolecxx . . $ Konsole/ {
29
30 /**
31 * A class to parse and extract information about shell commands.
32 *
33 * ShellCommand can be used to:
34 *
35 * <ul>
36 * <li>Take a command-line (eg "/bin/sh -c /path/to/my/script") and split it
37 * into its component parts (eg. the command "/bin/sh" and the arguments
38 * "-c","/path/to/my/script")
39 * </li>
40 * <li>Take a command and a list of arguments and combine them to
41 * form a complete command line.
42 * </li>
43 * <li>Determine whether the binary specified by a command exists in the
44 * user's PATH.
45 * </li>
46 * <li>Determine whether a command-line specifies the execution of
47 * another command as the root user using su/sudo etc.
48 * </li>
49 * </ul>
50 */
51 class ShellCommandcxx . . $ Konsole/ShellCommand# {
52 public:
53 /**
54 * Constructs a ShellCommand from a command line.
55 *
56 * @param fullCommand The command line to parse.
57 */
58 ShellCommandcxx . . $ Konsole/ShellCommand#ShellCommand(3520e46b33348bf6).(const QStringcxx . . $ QString# & fullCommand);
59 /**
60 * Constructs a ShellCommand with the specified @p command and @p arguments.
61 */
62 ShellCommandcxx . . $ Konsole/ShellCommand#ShellCommand(4a8467afe4f213e4).(const QStringcxx . . $ QString# & command , const QStringListcxx . . $ QStringList# & arguments);
63
64 /** Returns the command. */
65 QStringcxx . . $ QString# commandcxx . . $ Konsole/ShellCommand#command(6ef7b6c27b00b43d).() const;
66 /** Returns the arguments. */
67 QStringListcxx . . $ QStringList# argumentscxx . . $ Konsole/ShellCommand#arguments(e1dbd5c4feadc8f5).() const;
68
69 /**
70 * Returns the full command line.
71 */
72 QStringcxx . . $ QString# fullCommandcxx . . $ Konsole/ShellCommand#fullCommand(6ef7b6c27b00b43d).() const;
73
74 /** Returns true if this is a root command. */
75 bool isRootCommandcxx . . $ Konsole/ShellCommand#isRootCommand(50ce9a9e25b4a850).() const;
76 /** Returns true if the program specified by @p command() exists. */
77 bool isAvailablecxx . . $ Konsole/ShellCommand#isAvailable(50ce9a9e25b4a850).() const;
78
79 /** Expands environment variables in @p text .*/
80 static QStringcxx . . $ QString# expandcxx . . $ Konsole/ShellCommand#expand(fd988a2ab94d906b).(const QStringcxx . . $ QString# & text);
81
82 /** Expands environment variables in each string in @p list. */
83 static QStringListcxx . . $ QStringList# expandcxx . . $ Konsole/ShellCommand#expand(5a14ab7320a56439).(const QStringListcxx . . $ QStringList# & items);
84
85 private:
86 QStringListcxx . . $ QStringList# _argumentscxx . . $ Konsole/ShellCommand#_arguments.;
87 };
88
89 }
90
91 #endif // SHELLCOMMAND_H
92