summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KShell.java
blob: 0af362305f68ba4002d09ba3694da7ea0bf0e6fc (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QtSupport;
import java.util.ArrayList;

/**

 \namespace KShell
 Provides some basic POSIX shell and bash functionality.
		@short    \namespace KShell  Provides some basic POSIX shell and bash functionality.
		@see KStringHandler

*/
public class KShell {
	/**	
		 Flags for splitArgs().
		     		@short    Flags for splitArgs().
	*/
	public static final int NoOptions = 0;
	public static final int TildeExpand = 1;
	public static final int AbortOnMeta = 2;

	/**	
		 Status codes from splitArgs()
		     		@short    Status codes from splitArgs()
	*/
	public static final int NoError = 0;
	public static final int BadQuoting = 1;
	public static final int FoundMeta = 2;

	/**	
		 Splits <code>cmd</code> according to POSIX shell word splitting and quoting rules.
		 Can optionally perform tilde expansion and/or abort if it finds shell
		 meta characters it cannot process.
			@param cmd the command to split
			@param flags operation flags, see Options
			@param err if not NULL, a status code will be stored at the pointer
		  target, see Errors
				@return a list of unquoted words or an empty list if an error occurred
     
		@short    Splits <code>cmd</code> according to POSIX shell word splitting and quoting rules.
	*/
	public static native ArrayList splitArgs(String cmd, int flags, int[] err);
	public static native ArrayList splitArgs(String cmd, int flags);
	public static native ArrayList splitArgs(String cmd);
	/**	
		 Quotes and joins <code>args</code> together according to POSIX shell rules.
			@param args a list of strings to quote and join
				@return a command suitable for shell execution
     
		@short    Quotes and joins <code>args</code> together according to POSIX shell rules.
	*/
	public static native String joinArgs(String[] args);
	/**	
		 Same as above, but $'' is used instead of '' for the quoting.
		 The output is suitable for splitArgs(), bash, zsh and possibly
		 other bourne-compatible shells, but not for plain sh. The advantage
		 is, that control characters (ASCII less than 32) are escaped into
		 human-readable strings.
			@param args a list of strings to quote and join
				@return a command suitable for shell execution
     
		@short    Same as above, but $'' is used instead of '' for the quoting.
	*/
	public static native String joinArgsDQ(String[] args);
	/**	
		 Quotes and joins <code>argv</code> together according to POSIX shell rules.
			@param argv an array of c strings to quote and join.
		  The strings are expected to be in local-8-bit encoding.
					@return a command suitable for shell execution
     
		@short    Quotes and joins <code>argv</code> together according to POSIX shell rules.
	*/
	// TQString joinArgs(const char** arg1,int arg2); >>>> NOT CONVERTED
	// TQString joinArgs(const char** arg1); >>>> NOT CONVERTED
	/**	
		 Performs tilde expansion on <code>path.</code> Interprets "~/path" and
		 "~user/path".
			@param path the path to tilde-expand
				@return the expanded path
     
		@short    Performs tilde expansion on <code>path.</code>
	*/
	public static native String tildeExpand(String path);
	/**	
		 Obtain a <code>user</code>'s home directory.
			@param user The name of the user whose home dir should be obtained.
		  An empty string denotes the current user.
				@return The user's home directory.
     
		@short    Obtain a <code>user</code>'s home directory.
	*/
	public static native String homeDir(String user);
}