From 960d2aa44cd64729292ebc48b7cb6eaf18534de5 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 25 Jan 2013 14:05:22 -0600 Subject: Rename KServer, KSocket, KIO_EXPORT, KIOInput, KIOJob, KIOConfig, KIOBuffer, and KBuffer to avoid conflicts with KDE4 --- kdejava/koala/kdejava/KBufferedIO.cpp | 87 ------------- kdejava/koala/kdejava/KBufferedIO.h | 29 ----- kdejava/koala/kdejava/TDEBufferedIO.cpp | 87 +++++++++++++ kdejava/koala/kdejava/TDEBufferedIO.h | 29 +++++ kdejava/koala/org/kde/koala/KBufferedIO.java | 144 --------------------- .../koala/org/kde/koala/KBufferedIOSignals.java | 45 ------- kdejava/koala/org/kde/koala/TDEBufferedIO.java | 144 +++++++++++++++++++++ .../koala/org/kde/koala/TDEBufferedIOSignals.java | 45 +++++++ 8 files changed, 305 insertions(+), 305 deletions(-) delete mode 100644 kdejava/koala/kdejava/KBufferedIO.cpp delete mode 100644 kdejava/koala/kdejava/KBufferedIO.h create mode 100644 kdejava/koala/kdejava/TDEBufferedIO.cpp create mode 100644 kdejava/koala/kdejava/TDEBufferedIO.h delete mode 100644 kdejava/koala/org/kde/koala/KBufferedIO.java delete mode 100644 kdejava/koala/org/kde/koala/KBufferedIOSignals.java create mode 100644 kdejava/koala/org/kde/koala/TDEBufferedIO.java create mode 100644 kdejava/koala/org/kde/koala/TDEBufferedIOSignals.java diff --git a/kdejava/koala/kdejava/KBufferedIO.cpp b/kdejava/koala/kdejava/KBufferedIO.cpp deleted file mode 100644 index acc25106..00000000 --- a/kdejava/koala/kdejava/KBufferedIO.cpp +++ /dev/null @@ -1,87 +0,0 @@ -//Auto-generated by kalyptus. DO NOT EDIT. -#include - -#include -#include -#include - -JNIEXPORT jint JNICALL -Java_org_kde_koala_TDEBufferedIO_bytesAvailable(JNIEnv* env, jobject obj) -{ - jint xret = (jint) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->bytesAvailable(); - return xret; -} - -JNIEXPORT jint JNICALL -Java_org_kde_koala_TDEBufferedIO_bytesToWrite(JNIEnv* env, jobject obj) -{ - jint xret = (jint) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->bytesToWrite(); - return xret; -} - -JNIEXPORT jboolean JNICALL -Java_org_kde_koala_TDEBufferedIO_canReadLine(JNIEnv* env, jobject obj) -{ - jboolean xret = (jboolean) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->canReadLine(); - return xret; -} - -JNIEXPORT jstring JNICALL -Java_org_kde_koala_TDEBufferedIO_className(JNIEnv* env, jobject obj) -{ - const char* _qstring; - _qstring = ((TDEBufferedIO*) QtSupport::getQt(env, obj))->className(); - return QtSupport::fromCharString(env, (char *) _qstring); -} - -JNIEXPORT void JNICALL -Java_org_kde_koala_TDEBufferedIO_closeNow(JNIEnv* env, jobject obj) -{ - ((TDEBufferedIO*) QtSupport::getQt(env, obj))->closeNow(); - return; -} - -JNIEXPORT jobject JNICALL -Java_org_kde_koala_TDEBufferedIO_metaObject(JNIEnv* env, jobject obj) -{ - jobject xret = QtSupport::objectForQtKey(env, (void*)((TDEBufferedIO*) QtSupport::getQt(env, obj))->metaObject(), "org.kde.qt.TQMetaObject"); - return xret; -} - -JNIEXPORT jint JNICALL -Java_org_kde_koala_TDEBufferedIO_peekBlock(JNIEnv* env, jobject obj, jstring data, jint maxlen) -{ -static TQCString* _qstring_data = 0; - jint xret = (jint) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->peekBlock((char*) QtSupport::toCharString(env, data, &_qstring_data), (uint) maxlen); - return xret; -} - -JNIEXPORT jboolean JNICALL -Java_org_kde_koala_TDEBufferedIO_setBufferSize__I(JNIEnv* env, jobject obj, jint rsize) -{ - jboolean xret = (jboolean) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->setBufferSize((int) rsize); - return xret; -} - -JNIEXPORT jboolean JNICALL -Java_org_kde_koala_TDEBufferedIO_setBufferSize__II(JNIEnv* env, jobject obj, jint rsize, jint wsize) -{ - jboolean xret = (jboolean) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->setBufferSize((int) rsize, (int) wsize); - return xret; -} - -JNIEXPORT jint JNICALL -Java_org_kde_koala_TDEBufferedIO_unreadBlock(JNIEnv* env, jobject obj, jstring data, jint len) -{ -static TQCString* _qstring_data = 0; - jint xret = (jint) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->unreadBlock((const char*) QtSupport::toCharString(env, data, &_qstring_data), (uint) len); - return xret; -} - -JNIEXPORT jint JNICALL -Java_org_kde_koala_TDEBufferedIO_waitForMore(JNIEnv* env, jobject obj, jint msec) -{ - jint xret = (jint) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->waitForMore((int) msec); - return xret; -} - diff --git a/kdejava/koala/kdejava/KBufferedIO.h b/kdejava/koala/kdejava/KBufferedIO.h deleted file mode 100644 index 768eafa7..00000000 --- a/kdejava/koala/kdejava/KBufferedIO.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ - -#ifndef __org_kde_koala_TDEBufferedIO__ -#define __org_kde_koala_TDEBufferedIO__ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDEBufferedIO_metaObject (JNIEnv *env, jobject); -extern JNIEXPORT jstring JNICALL Java_org_kde_koala_TDEBufferedIO_className (JNIEnv *env, jobject); -extern JNIEXPORT void JNICALL Java_org_kde_koala_TDEBufferedIO_closeNow (JNIEnv *env, jobject); -extern JNIEXPORT jboolean JNICALL Java_org_kde_koala_TDEBufferedIO_setBufferSize__II (JNIEnv *env, jobject, jint, jint); -extern JNIEXPORT jboolean JNICALL Java_org_kde_koala_TDEBufferedIO_setBufferSize__I (JNIEnv *env, jobject, jint); -extern JNIEXPORT jint JNICALL Java_org_kde_koala_TDEBufferedIO_bytesAvailable (JNIEnv *env, jobject); -extern JNIEXPORT jint JNICALL Java_org_kde_koala_TDEBufferedIO_waitForMore (JNIEnv *env, jobject, jint); -extern JNIEXPORT jint JNICALL Java_org_kde_koala_TDEBufferedIO_bytesToWrite (JNIEnv *env, jobject); -extern JNIEXPORT jboolean JNICALL Java_org_kde_koala_TDEBufferedIO_canReadLine (JNIEnv *env, jobject); -extern JNIEXPORT jint JNICALL Java_org_kde_koala_TDEBufferedIO_peekBlock (JNIEnv *env, jobject, jstring, jint); -extern JNIEXPORT jint JNICALL Java_org_kde_koala_TDEBufferedIO_unreadBlock (JNIEnv *env, jobject, jstring, jint); - -#ifdef __cplusplus -} -#endif - -#endif /* __org_kde_koala_TDEBufferedIO__ */ diff --git a/kdejava/koala/kdejava/TDEBufferedIO.cpp b/kdejava/koala/kdejava/TDEBufferedIO.cpp new file mode 100644 index 00000000..acc25106 --- /dev/null +++ b/kdejava/koala/kdejava/TDEBufferedIO.cpp @@ -0,0 +1,87 @@ +//Auto-generated by kalyptus. DO NOT EDIT. +#include + +#include +#include +#include + +JNIEXPORT jint JNICALL +Java_org_kde_koala_TDEBufferedIO_bytesAvailable(JNIEnv* env, jobject obj) +{ + jint xret = (jint) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->bytesAvailable(); + return xret; +} + +JNIEXPORT jint JNICALL +Java_org_kde_koala_TDEBufferedIO_bytesToWrite(JNIEnv* env, jobject obj) +{ + jint xret = (jint) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->bytesToWrite(); + return xret; +} + +JNIEXPORT jboolean JNICALL +Java_org_kde_koala_TDEBufferedIO_canReadLine(JNIEnv* env, jobject obj) +{ + jboolean xret = (jboolean) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->canReadLine(); + return xret; +} + +JNIEXPORT jstring JNICALL +Java_org_kde_koala_TDEBufferedIO_className(JNIEnv* env, jobject obj) +{ + const char* _qstring; + _qstring = ((TDEBufferedIO*) QtSupport::getQt(env, obj))->className(); + return QtSupport::fromCharString(env, (char *) _qstring); +} + +JNIEXPORT void JNICALL +Java_org_kde_koala_TDEBufferedIO_closeNow(JNIEnv* env, jobject obj) +{ + ((TDEBufferedIO*) QtSupport::getQt(env, obj))->closeNow(); + return; +} + +JNIEXPORT jobject JNICALL +Java_org_kde_koala_TDEBufferedIO_metaObject(JNIEnv* env, jobject obj) +{ + jobject xret = QtSupport::objectForQtKey(env, (void*)((TDEBufferedIO*) QtSupport::getQt(env, obj))->metaObject(), "org.kde.qt.TQMetaObject"); + return xret; +} + +JNIEXPORT jint JNICALL +Java_org_kde_koala_TDEBufferedIO_peekBlock(JNIEnv* env, jobject obj, jstring data, jint maxlen) +{ +static TQCString* _qstring_data = 0; + jint xret = (jint) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->peekBlock((char*) QtSupport::toCharString(env, data, &_qstring_data), (uint) maxlen); + return xret; +} + +JNIEXPORT jboolean JNICALL +Java_org_kde_koala_TDEBufferedIO_setBufferSize__I(JNIEnv* env, jobject obj, jint rsize) +{ + jboolean xret = (jboolean) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->setBufferSize((int) rsize); + return xret; +} + +JNIEXPORT jboolean JNICALL +Java_org_kde_koala_TDEBufferedIO_setBufferSize__II(JNIEnv* env, jobject obj, jint rsize, jint wsize) +{ + jboolean xret = (jboolean) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->setBufferSize((int) rsize, (int) wsize); + return xret; +} + +JNIEXPORT jint JNICALL +Java_org_kde_koala_TDEBufferedIO_unreadBlock(JNIEnv* env, jobject obj, jstring data, jint len) +{ +static TQCString* _qstring_data = 0; + jint xret = (jint) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->unreadBlock((const char*) QtSupport::toCharString(env, data, &_qstring_data), (uint) len); + return xret; +} + +JNIEXPORT jint JNICALL +Java_org_kde_koala_TDEBufferedIO_waitForMore(JNIEnv* env, jobject obj, jint msec) +{ + jint xret = (jint) ((TDEBufferedIO*) QtSupport::getQt(env, obj))->waitForMore((int) msec); + return xret; +} + diff --git a/kdejava/koala/kdejava/TDEBufferedIO.h b/kdejava/koala/kdejava/TDEBufferedIO.h new file mode 100644 index 00000000..768eafa7 --- /dev/null +++ b/kdejava/koala/kdejava/TDEBufferedIO.h @@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ + +#ifndef __org_kde_koala_TDEBufferedIO__ +#define __org_kde_koala_TDEBufferedIO__ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDEBufferedIO_metaObject (JNIEnv *env, jobject); +extern JNIEXPORT jstring JNICALL Java_org_kde_koala_TDEBufferedIO_className (JNIEnv *env, jobject); +extern JNIEXPORT void JNICALL Java_org_kde_koala_TDEBufferedIO_closeNow (JNIEnv *env, jobject); +extern JNIEXPORT jboolean JNICALL Java_org_kde_koala_TDEBufferedIO_setBufferSize__II (JNIEnv *env, jobject, jint, jint); +extern JNIEXPORT jboolean JNICALL Java_org_kde_koala_TDEBufferedIO_setBufferSize__I (JNIEnv *env, jobject, jint); +extern JNIEXPORT jint JNICALL Java_org_kde_koala_TDEBufferedIO_bytesAvailable (JNIEnv *env, jobject); +extern JNIEXPORT jint JNICALL Java_org_kde_koala_TDEBufferedIO_waitForMore (JNIEnv *env, jobject, jint); +extern JNIEXPORT jint JNICALL Java_org_kde_koala_TDEBufferedIO_bytesToWrite (JNIEnv *env, jobject); +extern JNIEXPORT jboolean JNICALL Java_org_kde_koala_TDEBufferedIO_canReadLine (JNIEnv *env, jobject); +extern JNIEXPORT jint JNICALL Java_org_kde_koala_TDEBufferedIO_peekBlock (JNIEnv *env, jobject, jstring, jint); +extern JNIEXPORT jint JNICALL Java_org_kde_koala_TDEBufferedIO_unreadBlock (JNIEnv *env, jobject, jstring, jint); + +#ifdef __cplusplus +} +#endif + +#endif /* __org_kde_koala_TDEBufferedIO__ */ diff --git a/kdejava/koala/org/kde/koala/KBufferedIO.java b/kdejava/koala/org/kde/koala/KBufferedIO.java deleted file mode 100644 index 0af84786..00000000 --- a/kdejava/koala/org/kde/koala/KBufferedIO.java +++ /dev/null @@ -1,144 +0,0 @@ -//Auto-generated by kalyptus. DO NOT EDIT. -package org.kde.koala; - -import org.kde.qt.Qt; -import org.kde.qt.TQMetaObject; -import org.kde.qt.QtSupport; - -/** - - This abstract class implements basic functionality for buffered - input/output. - Through the available methods, you can find out how many bytes are - available for reading, how many are still unsent and you can peek at - the buffered data. - This class was intentionally written to resemble TQSocket, because - KExtendedSocket is a subclass of this one. This is so that applications - written using TQSocket's buffering characteristics will be more easily - ported to the more powerful KExtendedSocket class. - TDEBufferedIO already provides a powerful internal buffering algorithm. However, - this does not include the I/O itself, which must be implemented in - derived classes. Thus, to implement a class that does some I/O, you must - override, in addition to the pure TQIODevice methods, these two: - -
  • - closeNow() -
  • - -
  • - waitForMore() -
  • - If your derived class reimplements the buffering algorithm, you must then - decide which buffering functions to override. For instance, you may want to - change the protected functions like feedReadBuffer() and consumeReadBuffer(). - See {@link TDEBufferedIOSignals} for signals emitted by TDEBufferedIO - @author Thiago Macieira - - @short Buffered I/O. - -*/ -public class TDEBufferedIO extends KAsyncIO { - protected TDEBufferedIO(Class dummy){super((Class) null);} - /** - The modes for closed() signal - @short The modes for closed() signal - */ - public static final int availRead = 0x01; - public static final int dirtyWrite = 0x02; - public static final int involuntary = 0x10; - public static final int delayed = 0x20; - public static final int closedNow = 0x40; - - public native TQMetaObject metaObject(); - public native String className(); - /** - Closes the stream now, discarding the contents of the - write buffer. That is, we won't try to flush that - buffer before closing. If you want that buffer to be - flushed, you can call TQIODevice.flush(), which is blocking, and - then closeNow, or you can call TQIODevice.close() for a delayed - close. - @short Closes the stream now, discarding the contents of the write buffer. - */ - public native void closeNow(); - /** - Sets the internal buffer size to value. - Not all implementations support this. - The parameters may be 0 to make the class unbuffered or -1 - to let the class choose the size (which may be unlimited) or - -2 to leave the buffer size untouched. - Note that setting the write buffer size to any value smaller than - the current size of the buffer will force it to flush first, - which can make this call blocking. - The default implementation does not support setting the buffer - sizes. You can only call this function with values -1 for "don't care" - or -2 for "unchanged" - @param rsize the size of the read buffer - @param wsize the size of the write buffer - @return true if setting both was ok. If false is returned, the - buffers were left unchanged. - - @short Sets the internal buffer size to value. - */ - public native boolean setBufferSize(int rsize, int wsize); - public native boolean setBufferSize(int rsize); - /** - Returns the number of bytes available for reading in the read buffer - @return the number of bytes available for reading - - @short Returns the number of bytes available for reading in the read buffer - */ - public native int bytesAvailable(); - /** - Waits for more data to be available and returns the amount of available data then. - @param msec number of milliseconds to wait, -1 to wait forever - @return -1 if we cannot wait (e.g., that doesn't make sense in this stream) - - @short Waits for more data to be available and returns the amount of available data then. - */ - public native int waitForMore(int msec); - /** - Returns the number of bytes yet to write, still in the write buffer - @return the number of unwritten bytes in the write buffer - - @short Returns the number of bytes yet to write, still in the write buffer - */ - public native int bytesToWrite(); - /** - Checks whether there is enough data in the buffer to read a line - The default implementation reads directly from inBuf, so if your - implementation changes the meaning of that member, then you must override - this function. - @return true when there is enough data in the buffer to read a line - - @short Checks whether there is enough data in the buffer to read a line - */ - public native boolean canReadLine(); - /** - Reads into the user buffer at most maxlen bytes, but does not - consume that data from the read buffer. This is useful to check - whether we already have the needed data to process something. - This function may want to try and read more data from the system - provided it won't block. - @param data the user buffer pointer, at least maxlen bytes long - @param maxlen the maximum length to be peeked - @return the number of bytes actually copied. - - @short Reads into the user buffer at most maxlen bytes, but does not consume that data from the read buffer. - */ - public native int peekBlock(String data, int maxlen); - /** - Unreads some data. That is, write the data to the beginning of the - read buffer, so that next calls to readBlock or peekBlock will see - this data instead. - Note not all devices implement this since this could mean a semantic - problem. For instance, sockets are sequential devices, so they won't - accept unreading. - @param data the data to be unread - @param len the size of the data - @return the number of bytes actually unread - - @short Unreads some data. - */ - public native int unreadBlock(String data, int len); -} diff --git a/kdejava/koala/org/kde/koala/KBufferedIOSignals.java b/kdejava/koala/org/kde/koala/KBufferedIOSignals.java deleted file mode 100644 index 1b81b725..00000000 --- a/kdejava/koala/org/kde/koala/KBufferedIOSignals.java +++ /dev/null @@ -1,45 +0,0 @@ -//Auto-generated by kalyptus. DO NOT EDIT. -package org.kde.koala; - -import org.kde.qt.TQMetaObject; -import org.kde.qt.QtSupport; - -public interface TDEBufferedIOSignals { - /** - This signal gets sent whenever bytes are written from the buffer. - @param nbytes the number of bytes sent. - @short This signal gets sent whenever bytes are written from the buffer. - */ - void bytesWritten(int nbytes); - /** - This signal gets sent when the stream is closed. The state parameter - will give the current state, in OR-ed bits: - -
  • - availRead: read buffer contains data to be read -
  • - -
  • - dirtyWrite: write buffer wasn't empty when the stream closed -
  • - -
  • - involuntary: the stream wasn't closed due to user request - (i.e., call to close). Probably remote end closed it -
  • - -
  • - delayed: the stream was closed voluntarily by the user, but it - happened only after the write buffer was emptied -
  • - -
  • - closedNow: the stream was closed voluntarily by the user, by - explicitly calling closeNow, which means the - write buffer's contents may have been discarded -
  • - @param state the state (see function description) - @short This signal gets sent when the stream is closed. - */ - void closed(int state); -} diff --git a/kdejava/koala/org/kde/koala/TDEBufferedIO.java b/kdejava/koala/org/kde/koala/TDEBufferedIO.java new file mode 100644 index 00000000..0af84786 --- /dev/null +++ b/kdejava/koala/org/kde/koala/TDEBufferedIO.java @@ -0,0 +1,144 @@ +//Auto-generated by kalyptus. DO NOT EDIT. +package org.kde.koala; + +import org.kde.qt.Qt; +import org.kde.qt.TQMetaObject; +import org.kde.qt.QtSupport; + +/** + + This abstract class implements basic functionality for buffered + input/output. + Through the available methods, you can find out how many bytes are + available for reading, how many are still unsent and you can peek at + the buffered data. + This class was intentionally written to resemble TQSocket, because + KExtendedSocket is a subclass of this one. This is so that applications + written using TQSocket's buffering characteristics will be more easily + ported to the more powerful KExtendedSocket class. + TDEBufferedIO already provides a powerful internal buffering algorithm. However, + this does not include the I/O itself, which must be implemented in + derived classes. Thus, to implement a class that does some I/O, you must + override, in addition to the pure TQIODevice methods, these two: + +
  • + closeNow() +
  • + +
  • + waitForMore() +
  • + If your derived class reimplements the buffering algorithm, you must then + decide which buffering functions to override. For instance, you may want to + change the protected functions like feedReadBuffer() and consumeReadBuffer(). + See {@link TDEBufferedIOSignals} for signals emitted by TDEBufferedIO + @author Thiago Macieira + + @short Buffered I/O. + +*/ +public class TDEBufferedIO extends KAsyncIO { + protected TDEBufferedIO(Class dummy){super((Class) null);} + /** + The modes for closed() signal + @short The modes for closed() signal + */ + public static final int availRead = 0x01; + public static final int dirtyWrite = 0x02; + public static final int involuntary = 0x10; + public static final int delayed = 0x20; + public static final int closedNow = 0x40; + + public native TQMetaObject metaObject(); + public native String className(); + /** + Closes the stream now, discarding the contents of the + write buffer. That is, we won't try to flush that + buffer before closing. If you want that buffer to be + flushed, you can call TQIODevice.flush(), which is blocking, and + then closeNow, or you can call TQIODevice.close() for a delayed + close. + @short Closes the stream now, discarding the contents of the write buffer. + */ + public native void closeNow(); + /** + Sets the internal buffer size to value. + Not all implementations support this. + The parameters may be 0 to make the class unbuffered or -1 + to let the class choose the size (which may be unlimited) or + -2 to leave the buffer size untouched. + Note that setting the write buffer size to any value smaller than + the current size of the buffer will force it to flush first, + which can make this call blocking. + The default implementation does not support setting the buffer + sizes. You can only call this function with values -1 for "don't care" + or -2 for "unchanged" + @param rsize the size of the read buffer + @param wsize the size of the write buffer + @return true if setting both was ok. If false is returned, the + buffers were left unchanged. + + @short Sets the internal buffer size to value. + */ + public native boolean setBufferSize(int rsize, int wsize); + public native boolean setBufferSize(int rsize); + /** + Returns the number of bytes available for reading in the read buffer + @return the number of bytes available for reading + + @short Returns the number of bytes available for reading in the read buffer + */ + public native int bytesAvailable(); + /** + Waits for more data to be available and returns the amount of available data then. + @param msec number of milliseconds to wait, -1 to wait forever + @return -1 if we cannot wait (e.g., that doesn't make sense in this stream) + + @short Waits for more data to be available and returns the amount of available data then. + */ + public native int waitForMore(int msec); + /** + Returns the number of bytes yet to write, still in the write buffer + @return the number of unwritten bytes in the write buffer + + @short Returns the number of bytes yet to write, still in the write buffer + */ + public native int bytesToWrite(); + /** + Checks whether there is enough data in the buffer to read a line + The default implementation reads directly from inBuf, so if your + implementation changes the meaning of that member, then you must override + this function. + @return true when there is enough data in the buffer to read a line + + @short Checks whether there is enough data in the buffer to read a line + */ + public native boolean canReadLine(); + /** + Reads into the user buffer at most maxlen bytes, but does not + consume that data from the read buffer. This is useful to check + whether we already have the needed data to process something. + This function may want to try and read more data from the system + provided it won't block. + @param data the user buffer pointer, at least maxlen bytes long + @param maxlen the maximum length to be peeked + @return the number of bytes actually copied. + + @short Reads into the user buffer at most maxlen bytes, but does not consume that data from the read buffer. + */ + public native int peekBlock(String data, int maxlen); + /** + Unreads some data. That is, write the data to the beginning of the + read buffer, so that next calls to readBlock or peekBlock will see + this data instead. + Note not all devices implement this since this could mean a semantic + problem. For instance, sockets are sequential devices, so they won't + accept unreading. + @param data the data to be unread + @param len the size of the data + @return the number of bytes actually unread + + @short Unreads some data. + */ + public native int unreadBlock(String data, int len); +} diff --git a/kdejava/koala/org/kde/koala/TDEBufferedIOSignals.java b/kdejava/koala/org/kde/koala/TDEBufferedIOSignals.java new file mode 100644 index 00000000..1b81b725 --- /dev/null +++ b/kdejava/koala/org/kde/koala/TDEBufferedIOSignals.java @@ -0,0 +1,45 @@ +//Auto-generated by kalyptus. DO NOT EDIT. +package org.kde.koala; + +import org.kde.qt.TQMetaObject; +import org.kde.qt.QtSupport; + +public interface TDEBufferedIOSignals { + /** + This signal gets sent whenever bytes are written from the buffer. + @param nbytes the number of bytes sent. + @short This signal gets sent whenever bytes are written from the buffer. + */ + void bytesWritten(int nbytes); + /** + This signal gets sent when the stream is closed. The state parameter + will give the current state, in OR-ed bits: + +
  • + availRead: read buffer contains data to be read +
  • + +
  • + dirtyWrite: write buffer wasn't empty when the stream closed +
  • + +
  • + involuntary: the stream wasn't closed due to user request + (i.e., call to close). Probably remote end closed it +
  • + +
  • + delayed: the stream was closed voluntarily by the user, but it + happened only after the write buffer was emptied +
  • + +
  • + closedNow: the stream was closed voluntarily by the user, by + explicitly calling closeNow, which means the + write buffer's contents may have been discarded +
  • + @param state the state (see function description) + @short This signal gets sent when the stream is closed. + */ + void closed(int state); +} -- cgit v1.2.3