//Auto-generated by kalyptus. DO NOT EDIT.
package org.trinitydesktop.koala;

import org.trinitydesktop.qt.TQt;
import org.trinitydesktop.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);
}
