summaryrefslogtreecommitdiff
path: root/libopie/oprocess.h
authorzecke <zecke>2003-05-07 14:45:49 (UTC)
committer zecke <zecke>2003-05-07 14:45:49 (UTC)
commit9602e59e3baf01465f4b4139715f2196bb01e012 (patch) (side-by-side diff)
tree2d7f0dbf91e88de3981fcc82d49ba8ddc05cfbd5 /libopie/oprocess.h
parentda949558a957ec4817bf610d7c9186585c0d2d92 (diff)
downloadopie-9602e59e3baf01465f4b4139715f2196bb01e012.zip
opie-9602e59e3baf01465f4b4139715f2196bb01e012.tar.gz
opie-9602e59e3baf01465f4b4139715f2196bb01e012.tar.bz2
Add d ptr
add comments and FIXMEs three new signals for otodoaccess
Diffstat (limited to 'libopie/oprocess.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/oprocess.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/libopie/oprocess.h b/libopie/oprocess.h
index f2853b0..af7cddb 100644
--- a/libopie/oprocess.h
+++ b/libopie/oprocess.h
@@ -181,262 +181,256 @@ public:
NotifyOnExit,
/**
* The application is suspended until the started process is finished.
*/
Block };
/**
* Constructor
*/
OProcess(QObject *parent = 0, const char *name = 0);
/**
* Constructor
*/
OProcess(const QString &arg0, QObject *parent = 0, const char *name = 0);
/**
* Constructor
*/
OProcess(const QStringList &args, QObject *parent = 0, const char *name = 0);
/**
*Destructor:
*
* If the process is running when the destructor for this class
* is called, the child process is killed with a SIGKILL, but
* only if the run mode is not of type @p DontCare.
* Processes started as @p DontCare keep running anyway.
*/
virtual ~OProcess();
/**
@deprecated
The use of this function is now deprecated. -- Please use the
"operator<<" instead of "setExecutable".
Sets the executable to be started with this OProcess object.
Returns false if the process is currently running (in that
case the executable remains unchanged.)
@see operator<<
*/
bool setExecutable(const QString& proc);
/**
* Sets the executable and the command line argument list for this process.
*
* For example, doing an "ls -l /usr/local/bin" can be achieved by:
* <pre>
* OProcess p;
* ...
* p << "ls" << "-l" << "/usr/local/bin"
* </pre>
*
**/
OProcess &operator<<(const QString& arg);
/**
* Similar to previous method, takes a char *, supposed to be in locale 8 bit already.
*/
OProcess &operator<<(const char * arg);
/**
* Similar to previous method, takes a QCString, supposed to be in locale 8 bit already.
*/
OProcess &operator<<(const QCString & arg);
/**
* Sets the executable and the command line argument list for this process,
* in a single method call, or add a list of arguments.
**/
OProcess &operator<<(const QStringList& args);
/**
* Clear a command line argument list that has been set by using
* the "operator<<".
*/
void clearArguments();
/**
* Starts the process.
* For a detailed description of the
* various run modes and communication semantics, have a look at the
* general description of the OProcess class.
*
* The following problems could cause this function to
* return false:
*
* @li The process is already running.
* @li The command line argument list is empty.
* @li The starting of the process failed (could not fork).
* @li The executable was not found.
*
* @param comm Specifies which communication links should be
* established to the child process (stdin/stdout/stderr). By default,
* no communication takes place and the respective communication
* signals will never get emitted.
*
* @return true on success, false on error
* (see above for error conditions)
**/
virtual bool start(RunMode runmode = NotifyOnExit,
Communication comm = NoCommunication);
/**
* Stop the process (by sending it a signal).
*
* @param signo The signal to send. The default is SIGTERM.
* @return @p true if the signal was delivered successfully.
*/
virtual bool kill(int signo = SIGTERM);
/**
@return @p true if the process is (still) considered to be running
*/
bool isRunning() const;
/** Returns the process id of the process.
*
* If it is called after
* the process has exited, it returns the process id of the last
* child process that was created by this instance of OProcess.
*
* Calling it before any child process has been started by this
* OProcess instance causes pid() to return 0.
**/
pid_t pid() const;
/**
- * Use pid().
- * @deprecated
- */
- pid_t getPid() const { return pid(); }
-
- /**
* Suspend processing of data from stdout of the child process.
*/
void suspend();
/**
* Resume processing of data from stdout of the child process.
*/
void resume();
/**
* @return @p true if the process has already finished and has exited
* "voluntarily", ie: it has not been killed by a signal.
*
* Note that you should check @ref OProcess::exitStatus() to determine
* whether the process completed its task successful or not.
*/
bool normalExit() const;
/**
* Returns the exit status of the process.
*
* Please use
* @ref OProcess::normalExit() to check whether the process has exited
* cleanly (i.e., @ref OProcess::normalExit() returns @p true) before calling
* this function because if the process did not exit normally,
* it does not have a valid exit status.
*/
int exitStatus() const;
/**
* Transmit data to the child process's stdin.
*
* OProcess::writeStdin may return false in the following cases:
*
* @li The process is not currently running.
*
* @li Communication to stdin has not been requested in the @ref start() call.
*
* @li Transmission of data to the child process by a previous call to
* @ref writeStdin() is still in progress.
*
* Please note that the data is sent to the client asynchronously,
* so when this function returns, the data might not have been
* processed by the child process.
*
* If all the data has been sent to the client, the signal
* @ref wroteStdin() will be emitted.
*
* Please note that you must not free "buffer" or call @ref writeStdin()
* again until either a @ref wroteStdin() signal indicates that the
* data has been sent or a @ref processHasExited() signal shows that
* the child process is no longer alive...
**/
bool writeStdin(const char *buffer, int buflen);
void flushStdin();
/**
* This causes the stdin file descriptor of the child process to be
* closed indicating an "EOF" to the child.
*
* @return @p false if no communication to the process's stdin
* had been specified in the call to @ref start().
*/
bool closeStdin();
/**
* This causes the stdout file descriptor of the child process to be
* closed.
*
* @return @p false if no communication to the process's stdout
* had been specified in the call to @ref start().
*/
bool closeStdout();
/**
* This causes the stderr file descriptor of the child process to be
* closed.
*
* @return @p false if no communication to the process's stderr
* had been specified in the call to @ref start().
*/
bool closeStderr();
/**
* Lets you see what your arguments are for debugging.
*/
const QValueList<QCString> &args() { return arguments; }
/**
* Controls whether the started process should drop any
* setuid/segid privileges or whether it should keep them
*
* The default is @p false : drop privileges
*/
void setRunPrivileged(bool keepPrivileges);
/**
* Returns whether the started process will drop any
* setuid/segid privileges or whether it will keep them
*/
bool runPrivileged() const;
/**
* Modifies the environment of the process to be started.
* This function must be called before starting the process.
*/
void setEnvironment(const QString &name, const QString &value);
/**
* Changes the current working directory (CWD) of the process
* to be started.
* This function must be called before starting the process.
*/
void setWorkingDirectory(const QString &dir);
/**
* Specify whether to start the command via a shell or directly.
* The default is to start the command directly.
* If @p useShell is true @p shell will be used as shell, or
* if shell is empty, the standard shell is used.
* @p quote A flag indicating whether to quote the arguments.
*
* When using a shell, the caller should make sure that all filenames etc.
* are properly quoted when passed as argument.
* @see quote()