summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KProcIO.java
diff options
context:
space:
mode:
Diffstat (limited to 'kdejava/koala/org/kde/koala/KProcIO.java')
-rw-r--r--kdejava/koala/org/kde/koala/KProcIO.java172
1 files changed, 172 insertions, 0 deletions
diff --git a/kdejava/koala/org/kde/koala/KProcIO.java b/kdejava/koala/org/kde/koala/KProcIO.java
new file mode 100644
index 00000000..39aaeb2c
--- /dev/null
+++ b/kdejava/koala/org/kde/koala/KProcIO.java
@@ -0,0 +1,172 @@
+//Auto-generated by kalyptus. DO NOT EDIT.
+package org.kde.koala;
+
+import org.kde.qt.Qt;
+import org.kde.qt.QMetaObject;
+import org.kde.qt.QtSupport;
+import org.kde.qt.QTextCodec;
+
+/**
+
+ KProcIO
+ This class provides a slightly simpler interface to the communication
+ functions provided by KProcess. The simplifications are:
+
+ <li>
+ The buffer for a write is copied to an internal KProcIO
+ buffer and maintained/freed appropriately. There is no need
+ to be concerned with wroteStdin() signals _at_all_.
+ </li>
+
+ <li>
+ readln() reads a line of data and buffers any leftovers.
+ </li>
+
+ <li>
+ Conversion from/to unicode.
+ </li>
+ Basically, KProcIO gives you buffered I/O similar to fgets()/fputs().
+ Aside from these, and the fact that start() takes different
+ parameters, use this class just like KProcess.
+ See {@link KProcIOSignals} for signals emitted by KProcIO
+ @author David Sweet
+
+ @short A slightly simpler interface to KProcess.
+
+*/
+public class KProcIO extends KProcess {
+ protected KProcIO(Class dummy){super((Class) null);}
+ public native QMetaObject metaObject();
+ public native String className();
+ /**
+ Constructor
+ @short Constructor
+ */
+ public KProcIO(QTextCodec codec) {
+ super((Class) null);
+ newKProcIO(codec);
+ }
+ private native void newKProcIO(QTextCodec codec);
+ public KProcIO() {
+ super((Class) null);
+ newKProcIO();
+ }
+ private native void newKProcIO();
+ /**
+ Sets the communication mode to be passed to KProcess.start()
+ by start(). The default communication mode is KProcess.All.
+ You probably want to use this function in conjunction with
+ KProcess.setUsePty().
+ @param comm the communication mode
+ @short Sets the communication mode to be passed to KProcess.start() by start().
+ */
+ public native void setComm(int comm);
+ /**
+ Starts the process. It will fail in the following cases:
+
+ <li>
+ The process is already running.
+ </li>
+
+ <li>
+ The command line argument list is empty.
+ </li>
+
+ <li>
+ The starting of the process failed (could not fork).
+ </li>
+
+ <li>
+ The executable was not found.
+ </li>
+ @param runmode For a detailed description of the
+ various run modes, have a look at the
+ general description of the KProcess class.
+ @param includeStderr If true, data from both stdout and stderr is
+ listened to. If false, only stdout is listened to.
+ @return true on success, false on error.
+
+ @short Starts the process.
+ */
+ public native boolean start(int runmode, boolean includeStderr);
+ public native boolean start(int runmode);
+ public native boolean start();
+ /**
+ Writes text to stdin of the process.
+ @param line Text to write.
+ @param appendnewline if true, a newline '\\n' is appended.
+ @return true if successful, false otherwise
+
+ @short Writes text to stdin of the process.
+ */
+ public native boolean writeStdin(String line, boolean appendnewline);
+ public native boolean writeStdin(String line);
+ /**
+ Writes data to stdin of the process.
+ @param data Data to write.
+ @return true if successful, false otherwise
+
+ @short Writes data to stdin of the process.
+ */
+ public native boolean writeStdin(byte[] data);
+ /**
+ Closes stdin after all data has been send.
+ @short Closes stdin after all data has been send.
+ */
+ public native void closeWhenDone();
+ /**
+ Reads a line of text (up to and including '\\n').
+ Use readln() in response to a readReady() signal.
+ You may use it multiple times if more than one line of data is
+ available.
+ Be sure to use ackRead() when you have finished processing the
+ readReady() signal. This informs KProcIO that you are ready for
+ another readReady() signal.
+ readln() never blocks.
+ autoAck==true makes these functions call ackRead() for you.
+ @param line is used to store the line that was read.
+ @param autoAck when true, ackRead() is called for you.
+ @param partial when provided the line is returned
+ even if it does not contain a '\\n'. partial will be set to
+ false if the line contains a '\\n' and false otherwise.
+ @return the number of characters read, or -1 if no data is available.
+
+ @short Reads a line of text (up to and including '\\n').
+ */
+ public native int readln(StringBuffer line, boolean autoAck, boolean[] partial);
+ public native int readln(StringBuffer line, boolean autoAck);
+ public native int readln(StringBuffer line);
+ /**
+ Reset the class. Doesn't kill the process.
+ @short Reset the class.
+ */
+ public native void resetAll();
+ /**
+ Call this after you have finished processing a readReady()
+ signal. This call need not be made in the slot that was signalled
+ by readReady(). You won't receive any more readReady() signals
+ until you acknowledge with ackRead(). This prevents your slot
+ from being reentered while you are still processing the current
+ data. If this doesn't matter, then call ackRead() right away in
+ your readReady()-processing slot.
+ @short Call this after you have finished processing a readReady() signal.
+ */
+ public native void ackRead();
+ /**
+ Turns readReady() signals on and off.
+ You can turn this off at will and not worry about losing any data.
+ (as long as you turn it back on at some point...)
+ @param enable true to turn the signals on, false to turn them off
+ @short Turns readReady() signals on and off.
+ */
+ public native void enableReadSignals(boolean enable);
+ protected native void controlledEmission();
+ protected native void received(KProcess proc, String buffer, int buflen);
+ protected native void sent(KProcess arg1);
+ /** Deletes the wrapped C++ instance */
+ protected native void finalize() throws InternalError;
+ /** Delete the wrapped C++ instance ahead of finalize() */
+ public native void dispose();
+ /** Has the wrapped C++ instance been deleted? */
+ public native boolean isDisposed();
+}