io.qt.core.QIODevice Maven / Gradle / Ivy
package io.qt.core;
/**
* The base interface class of all I/O devices in Qt
* Java wrapper for Qt class QIODevice
*/
public abstract class QIODevice extends io.qt.core.QObject
implements io.qt.core.QIODeviceBase
{
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QIODevice.class);
@io.qt.NativeAccess
private static final class ConcreteWrapper extends QIODevice {
@io.qt.NativeAccess
private ConcreteWrapper(QPrivateConstructor p) { super(p); }
@Override
@io.qt.QtUninvokable
protected int readData(byte[] data){
return readData_native_char_ptr_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), data);
}
@io.qt.QtUninvokable
private native int readData_native_char_ptr_long_long(long __this__nativeId, byte[] data);
@Override
@io.qt.QtUninvokable
protected int writeData(byte[] data){
return writeData_native_const_char_ptr_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), data);
}
@io.qt.QtUninvokable
private native int writeData_native_const_char_ptr_long_long(long __this__nativeId, byte[] data);
}
/**
*
*/
public final Signal0 aboutToClose = new Signal0();
/**
* See QIODevice::bytesWritten(qint64)
*/
public final Signal1<@io.qt.QtPrimitiveType Long> bytesWritten = new Signal1<>();
/**
* See QIODevice::channelBytesWritten(int,qint64)
*/
public final Signal2<@io.qt.QtPrimitiveType Integer, @io.qt.QtPrimitiveType Long> channelBytesWritten = new Signal2<>();
/**
* See QIODevice::channelReadyRead(int)
*/
public final Signal1<@io.qt.QtPrimitiveType Integer> channelReadyRead = new Signal1<>();
/**
* See QIODevice::readChannelFinished()
*/
public final Signal0 readChannelFinished = new Signal0();
/**
*
*/
public final Signal0 readyRead = new Signal0();
/**
*
*/
public QIODevice(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QIODevice instance);
/**
* See QIODevice::QIODevice(QObject*)
*/
public QIODevice(io.qt.core.QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, parent);
}
private native static void initialize_native(QIODevice instance, io.qt.core.QObject parent);
/**
* See QIODevice::commitTransaction()
*/
@io.qt.QtUninvokable
public final void commitTransaction(){
commitTransaction_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native void commitTransaction_native(long __this__nativeId);
/**
* See QIODevice::currentReadChannel()const
*/
@io.qt.QtUninvokable
public final int currentReadChannel(){
return currentReadChannel_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native int currentReadChannel_native_constfct(long __this__nativeId);
/**
* See QIODevice::currentWriteChannel()const
*/
@io.qt.QtUninvokable
public final int currentWriteChannel(){
return currentWriteChannel_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native int currentWriteChannel_native_constfct(long __this__nativeId);
/**
* See QIODevice::errorString()const
*/
@io.qt.QtUninvokable
public final java.lang.String errorString(){
return errorString_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native java.lang.String errorString_native_constfct(long __this__nativeId);
/**
*
*/
@io.qt.QtUninvokable
public final java.lang.Byte getByte(){
return getByte_native_char_ptr(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native java.lang.Byte getByte_native_char_ptr(long __this__nativeId);
/**
*
*/
@io.qt.QtUninvokable
public final boolean isOpen(){
return isOpen_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean isOpen_native_constfct(long __this__nativeId);
/**
* See QIODevice::isReadable()const
*/
@io.qt.QtUninvokable
public final boolean isReadable(){
return isReadable_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean isReadable_native_constfct(long __this__nativeId);
/**
* See QIODevice::isTextModeEnabled()const
*/
@io.qt.QtUninvokable
public final boolean isTextModeEnabled(){
return isTextModeEnabled_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean isTextModeEnabled_native_constfct(long __this__nativeId);
/**
* See QIODevice::isTransactionStarted()const
*/
@io.qt.QtUninvokable
public final boolean isTransactionStarted(){
return isTransactionStarted_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean isTransactionStarted_native_constfct(long __this__nativeId);
/**
* See QIODevice::isWritable()const
*/
@io.qt.QtUninvokable
public final boolean isWritable(){
return isWritable_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean isWritable_native_constfct(long __this__nativeId);
/**
* See QIODevice::openMode()const
*/
@io.qt.QtUninvokable
public final io.qt.core.QIODeviceBase.OpenMode openMode(){
return new io.qt.core.QIODeviceBase.OpenMode(openMode_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int openMode_native_constfct(long __this__nativeId);
/**
* See QIODevice::peek(char*,qint64)
*/
@io.qt.QtUninvokable
public final int peek(byte[] data){
return peek_native_char_ptr_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), data);
}
@io.qt.QtUninvokable
private native int peek_native_char_ptr_long_long(long __this__nativeId, byte[] data);
/**
*
*/
@io.qt.QtUninvokable
public final io.qt.core.QByteArray peek(long maxlen){
return peek_native_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), maxlen);
}
@io.qt.QtUninvokable
private native io.qt.core.QByteArray peek_native_long_long(long __this__nativeId, long maxlen);
/**
*
*/
@io.qt.QtUninvokable
public final boolean putByte(byte c){
return putByte_native_char(QtJambi_LibraryUtilities.internal.nativeId(this), c);
}
@io.qt.QtUninvokable
private native boolean putByte_native_char(long __this__nativeId, byte c);
/**
* See QIODevice::read(char*,qint64)
*/
@io.qt.QtUninvokable
public final int read(byte[] data){
return read_native_char_ptr_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), data);
}
@io.qt.QtUninvokable
private native int read_native_char_ptr_long_long(long __this__nativeId, byte[] data);
/**
*
*/
@io.qt.QtUninvokable
public final io.qt.core.QByteArray read(long maxlen){
return read_native_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), maxlen);
}
@io.qt.QtUninvokable
private native io.qt.core.QByteArray read_native_long_long(long __this__nativeId, long maxlen);
/**
*
*/
@io.qt.QtUninvokable
public final io.qt.core.QByteArray readAll(){
return readAll_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QByteArray readAll_native(long __this__nativeId);
/**
* See QIODevice::readChannelCount()const
*/
@io.qt.QtUninvokable
public final int readChannelCount(){
return readChannelCount_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native int readChannelCount_native_constfct(long __this__nativeId);
/**
* See QIODevice::readLine(char*,qint64)
*/
@io.qt.QtUninvokable
public final int readLine(byte[] data){
return readLine_native_char_ptr_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), data);
}
@io.qt.QtUninvokable
private native int readLine_native_char_ptr_long_long(long __this__nativeId, byte[] data);
/**
* Overloaded function for {@link #readLine(long)}
* with maxlen = 0
.
*/
@io.qt.QtUninvokable
public final io.qt.core.QByteArray readLine() {
return readLine((long)0);
}
/**
* See QIODevice::readLine(qint64)
*/
@io.qt.QtUninvokable
public final io.qt.core.QByteArray readLine(long maxlen){
return readLine_native_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), maxlen);
}
@io.qt.QtUninvokable
private native io.qt.core.QByteArray readLine_native_long_long(long __this__nativeId, long maxlen);
/**
* See QIODevice::rollbackTransaction()
*/
@io.qt.QtUninvokable
public final void rollbackTransaction(){
rollbackTransaction_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native void rollbackTransaction_native(long __this__nativeId);
/**
* See QIODevice::setCurrentReadChannel(int)
*/
@io.qt.QtUninvokable
public final void setCurrentReadChannel(int channel){
setCurrentReadChannel_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), channel);
}
@io.qt.QtUninvokable
private native void setCurrentReadChannel_native_int(long __this__nativeId, int channel);
/**
* See QIODevice::setCurrentWriteChannel(int)
*/
@io.qt.QtUninvokable
public final void setCurrentWriteChannel(int channel){
setCurrentWriteChannel_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), channel);
}
@io.qt.QtUninvokable
private native void setCurrentWriteChannel_native_int(long __this__nativeId, int channel);
/**
* See QIODevice::setErrorString(QString)
*/
@io.qt.QtUninvokable
protected final void setErrorString(java.lang.String errorString){
setErrorString_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), errorString);
}
@io.qt.QtUninvokable
private native void setErrorString_native_cref_QString(long __this__nativeId, java.lang.String errorString);
/**
* Overloaded function for {@link #setOpenMode(io.qt.core.QIODeviceBase.OpenMode)}.
*/
@io.qt.QtUninvokable
protected final void setOpenMode(io.qt.core.QIODeviceBase.OpenModeFlag ... openMode){
setOpenMode(new io.qt.core.QIODeviceBase.OpenMode(openMode));
}
/**
* See QIODevice::setOpenMode(QIODeviceBase::OpenMode)
*/
@io.qt.QtUninvokable
protected final void setOpenMode(io.qt.core.QIODeviceBase.OpenMode openMode){
setOpenMode_native_QFlags_QIODeviceBase_OpenModeFlag_(QtJambi_LibraryUtilities.internal.nativeId(this), openMode.value());
}
@io.qt.QtUninvokable
private native void setOpenMode_native_QFlags_QIODeviceBase_OpenModeFlag_(long __this__nativeId, int openMode);
/**
* See QIODevice::setTextModeEnabled(bool)
*/
@io.qt.QtUninvokable
public final void setTextModeEnabled(boolean enabled){
setTextModeEnabled_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), enabled);
}
@io.qt.QtUninvokable
private native void setTextModeEnabled_native_bool(long __this__nativeId, boolean enabled);
/**
*
*/
@io.qt.QtUninvokable
public final long skip(long maxSize){
return skip_native_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), maxSize);
}
@io.qt.QtUninvokable
private native long skip_native_long_long(long __this__nativeId, long maxSize);
/**
* See QIODevice::startTransaction()
*/
@io.qt.QtUninvokable
public final void startTransaction(){
startTransaction_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native void startTransaction_native(long __this__nativeId);
/**
* See QIODevice::ungetChar(char)
*/
@io.qt.QtUninvokable
public final void ungetByte(byte c){
ungetByte_native_char(QtJambi_LibraryUtilities.internal.nativeId(this), c);
}
@io.qt.QtUninvokable
private native void ungetByte_native_char(long __this__nativeId, byte c);
/**
* See QIODevice::write(QByteArray)
*/
@io.qt.QtUninvokable
public final long write(io.qt.core.QByteArray data){
return write_native_cref_QByteArray(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(data));
}
@io.qt.QtUninvokable
private native long write_native_cref_QByteArray(long __this__nativeId, long data);
@io.qt.QtUninvokable
public final int write(byte[] data){
return write_native_const_char_ptr_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), data);
}
@io.qt.QtUninvokable
private native int write_native_const_char_ptr_long_long(long __this__nativeId, byte[] data);
/**
* See QIODevice::writeChannelCount()const
*/
@io.qt.QtUninvokable
public final int writeChannelCount(){
return writeChannelCount_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native int writeChannelCount_native_constfct(long __this__nativeId);
/**
*
*/
@io.qt.QtUninvokable
public boolean atEnd(){
return atEnd_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean atEnd_native_constfct(long __this__nativeId);
/**
* See QIODevice::bytesAvailable()const
*/
@io.qt.QtUninvokable
public long bytesAvailable(){
return bytesAvailable_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native long bytesAvailable_native_constfct(long __this__nativeId);
/**
* See QIODevice::bytesToWrite()const
*/
@io.qt.QtUninvokable
public long bytesToWrite(){
return bytesToWrite_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native long bytesToWrite_native_constfct(long __this__nativeId);
/**
* See QIODevice::canReadLine()const
*/
@io.qt.QtUninvokable
public boolean canReadLine(){
return canReadLine_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean canReadLine_native_constfct(long __this__nativeId);
/**
*
*/
@io.qt.QtUninvokable
public void close(){
close_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native void close_native(long __this__nativeId);
/**
* See QIODevice::isSequential()const
*/
@io.qt.QtUninvokable
public boolean isSequential(){
return isSequential_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean isSequential_native_constfct(long __this__nativeId);
/**
* Overloaded function for {@link #open(io.qt.core.QIODeviceBase.OpenMode)}.
*/
@io.qt.QtUninvokable
public final boolean open(io.qt.core.QIODeviceBase.OpenModeFlag ... mode){
return open(new io.qt.core.QIODeviceBase.OpenMode(mode));
}
/**
* See QIODevice::open(QIODeviceBase::OpenMode)
*/
@io.qt.QtUninvokable
public boolean open(io.qt.core.QIODeviceBase.OpenMode mode){
return open_native_QFlags_QIODeviceBase_OpenModeFlag_(QtJambi_LibraryUtilities.internal.nativeId(this), mode.value());
}
@io.qt.QtUninvokable
private native boolean open_native_QFlags_QIODeviceBase_OpenModeFlag_(long __this__nativeId, int mode);
/**
*
*/
@io.qt.QtUninvokable
public long pos(){
return pos_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native long pos_native_constfct(long __this__nativeId);
/**
* See QIODevice::readData(char*,qint64)
*/
@io.qt.QtUninvokable
protected abstract int readData(byte[] data);
@io.qt.QtUninvokable
private native int readData_native_char_ptr_long_long(long __this__nativeId, byte[] data);
/**
* See QIODevice::readLineData(char*,qint64)
*/
@io.qt.QtUninvokable
protected int readLineData(byte[] data){
return readLineData_native_char_ptr_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), data);
}
@io.qt.QtUninvokable
private native int readLineData_native_char_ptr_long_long(long __this__nativeId, byte[] data);
/**
*
*/
@io.qt.QtUninvokable
public boolean reset(){
return reset_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean reset_native(long __this__nativeId);
/**
*
*/
@io.qt.QtUninvokable
public boolean seek(long pos){
return seek_native_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), pos);
}
@io.qt.QtUninvokable
private native boolean seek_native_long_long(long __this__nativeId, long pos);
/**
*
*/
@io.qt.QtUninvokable
public long size(){
return size_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native long size_native_constfct(long __this__nativeId);
/**
* See QIODevice::skipData(qint64)
*/
@io.qt.QtUninvokable
protected long skipData(long maxSize){
return skipData_native_long_long(QtJambi_LibraryUtilities.internal.nativeId(this), maxSize);
}
@io.qt.QtUninvokable
private native long skipData_native_long_long(long __this__nativeId, long maxSize);
/**
* See QIODevice::waitForBytesWritten(int)
*/
@io.qt.QtUninvokable
public boolean waitForBytesWritten(int msecs){
return waitForBytesWritten_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), msecs);
}
@io.qt.QtUninvokable
private native boolean waitForBytesWritten_native_int(long __this__nativeId, int msecs);
/**
* See QIODevice::waitForReadyRead(int)
*/
@io.qt.QtUninvokable
public boolean waitForReadyRead(int msecs){
return waitForReadyRead_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), msecs);
}
@io.qt.QtUninvokable
private native boolean waitForReadyRead_native_int(long __this__nativeId, int msecs);
/**
* See QIODevice::writeData(const char*,qint64)
*/
@io.qt.QtUninvokable
protected abstract int writeData(byte[] data);
@io.qt.QtUninvokable
private native int writeData_native_const_char_ptr_long_long(long __this__nativeId, byte[] data);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected QIODevice(QPrivateConstructor p) { super(p); }
/**
* Constructor for internal use only.
* It is not allowed to call the declarative constructor from inside Java.
*/
@io.qt.NativeAccess
protected QIODevice(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@io.qt.QtUninvokable
private static native void initialize_native(QIODevice instance, QDeclarativeConstructor constructor);
public native static QIODevice fromDirectBuffer(java.nio.Buffer buffer);
public static QIODevice fromInputStream(java.io.InputStream stream) {
return new QIODevice() {
{
setOpenMode(QIODevice.OpenModeFlag.ReadOnly);
}
@Override
public boolean atEnd() {
return super.atEnd();
}
@Override
public long bytesAvailable() {
try {
return stream.available();
} catch (java.io.IOException e) {
return 0;
}
}
@Override
public long bytesToWrite() {
return 0;
}
@Override
public boolean canReadLine() {
return false;
}
@Override
public void close() {
try {
stream.close();
} catch (java.io.IOException e) {
}
super.close();
}
@Override
public boolean isSequential() {
return true;
}
@Override
public boolean open(OpenMode mode) {
if(mode.value()==OpenModeFlag.ReadOnly.value())
return super.open(mode);
else return false;
}
@Override
public long pos() {
return super.pos();
}
@Override
protected int readLineData(byte[] data) {
return 0;
}
@Override
public boolean reset() {
try {
stream.reset();
} catch (java.io.IOException e) {
return false;
}
return super.reset();
}
@Override
public boolean seek(long pos) {
return false;
}
@Override
public long size() {
return super.size();
}
@Override
protected long skipData(long maxSize) {
try {
stream.skip(maxSize);
} catch (java.io.IOException e) {
return 0;
}
return super.skipData(maxSize);
}
@Override
protected int writeData(byte[] data) {
return 0;
}
@Override
protected int readData(byte[] data) {
try {
return stream.read(data);
} catch (java.io.IOException e) {
return 0;
}
}
};
}
public static QIODevice fromOutputStream(java.io.OutputStream stream) {
return new QIODevice() {
{
setOpenMode(QIODevice.OpenModeFlag.WriteOnly);
}
@Override
public boolean atEnd() {
return super.atEnd();
}
@Override
public long bytesAvailable() {
return 0;
}
@Override
public long bytesToWrite() {
return 0;
}
@Override
public boolean canReadLine() {
return false;
}
@Override
public void close() {
try {
stream.close();
} catch (java.io.IOException e) {
}
super.close();
}
@Override
public boolean isSequential() {
return true;
}
@Override
public boolean open(OpenMode mode) {
if(mode.value()==OpenModeFlag.WriteOnly.value())
return super.open(mode);
else return false;
}
@Override
public long pos() {
return super.pos();
}
@Override
protected int readLineData(byte[] data) {
return 0;
}
@Override
public boolean reset() {
return false;
}
@Override
public boolean seek(long pos) {
return false;
}
@Override
public long size() {
return super.size();
}
@Override
protected long skipData(long maxSize) {
return 0;
}
@Override
protected int writeData(byte[] data) {
try {
stream.write(data);
return data.length;
} catch (java.io.IOException e) {
return 0;
}
}
@Override
protected int readData(byte[] data) {
return 0;
}
};
}
}