//Auto-generated by kalyptus. DO NOT EDIT.
#include <qfile.h>
#include <qglobal.h>
#include <qiodevice.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QFile.h>

class QFileJBridge : public QFile
{
public:
	QFileJBridge() : QFile() {};
	QFileJBridge(const QString& arg1) : QFile(arg1) {};
	void protected_setErrorString(const QString& arg1) {
		QFile::setErrorString(arg1);
		return;
	}
	~QFileJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFile_atEnd(JNIEnv* env, jobject obj)
{
	jboolean xret = (jboolean) ((QFile*) QtSupport::getQt(env, obj))->atEnd();
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QFile_at__(JNIEnv* env, jobject obj)
{
	jlong xret = (jlong) ((QFile*) QtSupport::getQt(env, obj))->at();
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFile_at__J(JNIEnv* env, jobject obj, jlong arg1)
{
	jboolean xret = (jboolean) ((QFile*) QtSupport::getQt(env, obj))->at((QIODevice::Offset) arg1);
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFile_close(JNIEnv* env, jobject obj)
{
	((QFile*) QtSupport::getQt(env, obj))->close();
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QFile_decodeName(JNIEnv* env, jclass cls, jstring localFileName)
{
	QString  _qstring;
	(void) cls;
static QCString* _qcstring_localFileName = 0;
	_qstring = QFileJBridge::decodeName((const QCString&)*(QCString*) QtSupport::toQCString(env, localFileName, &_qcstring_localFileName));
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFile_dispose(JNIEnv* env, jobject obj)
{
	Java_org_kde_qt_QFile_finalize(env, obj);
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QFile_encodeName(JNIEnv* env, jclass cls, jstring fileName)
{
	QCString  _qstring;
	(void) cls;
static QString* _qstring_fileName = 0;
	_qstring = QFileJBridge::encodeName((const QString&)*(QString*) QtSupport::toQString(env, fileName, &_qstring_fileName));
	return QtSupport::fromQCString(env, &_qstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QFile_errorString(JNIEnv* env, jobject obj)
{
	QString  _qstring;
	_qstring = ((QFile*) QtSupport::getQt(env, obj))->errorString();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFile_exists__(JNIEnv* env, jobject obj)
{
	jboolean xret = (jboolean) ((QFile*) QtSupport::getQt(env, obj))->exists();
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFile_exists__Ljava_lang_String_2(JNIEnv* env, jclass cls, jstring fileName)
{
	(void) cls;
static QString* _qstring_fileName = 0;
	jboolean xret = (jboolean) QFileJBridge::exists((const QString&)*(QString*) QtSupport::toQString(env, fileName, &_qstring_fileName));
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFile_finalize(JNIEnv* env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj)) {
		delete (QFile*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFile_flush(JNIEnv* env, jobject obj)
{
	((QFile*) QtSupport::getQt(env, obj))->flush();
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFile_getch(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QFile*) QtSupport::getQt(env, obj))->getch();
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFile_handle(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QFile*) QtSupport::getQt(env, obj))->handle();
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFile_isDisposed(JNIEnv* env, jobject obj)
{
	return (QtSupport::getQt(env, obj) == 0);
}

JNIEXPORT jstring JNICALL
Java_org_kde_qt_QFile_name(JNIEnv* env, jobject obj)
{
	QString  _qstring;
	_qstring = ((QFile*) QtSupport::getQt(env, obj))->name();
	return QtSupport::fromQString(env, &_qstring);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFile_newQFile__(JNIEnv* env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QFileJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFile_newQFile__Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring name)
{
static QString* _qstring_name = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QFileJBridge((const QString&)*(QString*) QtSupport::toQString(env, name, &_qstring_name)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFile_open__I(JNIEnv* env, jobject obj, jint arg1)
{
	jboolean xret = (jboolean) ((QFile*) QtSupport::getQt(env, obj))->open((int) arg1);
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFile_open__II(JNIEnv* env, jobject obj, jint arg1, jint arg2)
{
	jboolean xret = (jboolean) ((QFile*) QtSupport::getQt(env, obj))->open((int) arg1, (int) arg2);
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFile_putch(JNIEnv* env, jobject obj, jint arg1)
{
	jint xret = (jint) ((QFile*) QtSupport::getQt(env, obj))->putch((int) arg1);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QFile_readBlock(JNIEnv* env, jobject obj, jobject data, jlong len)
{
static QCString* _qstring_data = 0;
	if (_qstring_data == 0) { _qstring_data = new QCString(); }
	_qstring_data->resize((uint) len);
	jlong xret = (jlong) ((QFile*) QtSupport::getQt(env, obj))->readBlock((char*) _qstring_data->data(), (Q_ULONG) len);
	QtSupport::fromQCStringToStringBuffer(env, _qstring_data, data);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QFile_readLine__Ljava_lang_StringBuffer_2J(JNIEnv* env, jobject obj, jobject arg1, jlong maxlen)
{
static QString* _qstring_arg1 = 0;
	jlong xret = (jlong) ((QFile*) QtSupport::getQt(env, obj))->readLine((QString&)*(QString*) QtSupport::toQStringFromStringBuffer(env, arg1, &_qstring_arg1), (Q_ULONG) maxlen);
	QtSupport::fromQStringToStringBuffer(env, _qstring_arg1, arg1);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QFile_readLine__Ljava_lang_String_2J(JNIEnv* env, jobject obj, jstring data, jlong maxlen)
{
static QCString* _qstring_data = 0;
	jlong xret = (jlong) ((QFile*) QtSupport::getQt(env, obj))->readLine((char*) QtSupport::toCharString(env, data, &_qstring_data), (Q_ULONG) maxlen);
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFile_remove__(JNIEnv* env, jobject obj)
{
	jboolean xret = (jboolean) ((QFile*) QtSupport::getQt(env, obj))->remove();
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QFile_remove__Ljava_lang_String_2(JNIEnv* env, jclass cls, jstring fileName)
{
	(void) cls;
static QString* _qstring_fileName = 0;
	jboolean xret = (jboolean) QFileJBridge::remove((const QString&)*(QString*) QtSupport::toQString(env, fileName, &_qstring_fileName));
	return xret;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFile_setErrorString(JNIEnv* env, jobject obj, jstring arg1)
{
static QString* _qstring_arg1 = 0;
	((QFileJBridge*) QtSupport::getQt(env, obj))->protected_setErrorString((const QString&)*(QString*) QtSupport::toQString(env, arg1, &_qstring_arg1));
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QFile_setName(JNIEnv* env, jobject obj, jstring name)
{
static QString* _qstring_name = 0;
	((QFile*) QtSupport::getQt(env, obj))->setName((const QString&)*(QString*) QtSupport::toQString(env, name, &_qstring_name));
	return;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QFile_size(JNIEnv* env, jobject obj)
{
	jlong xret = (jlong) ((QFile*) QtSupport::getQt(env, obj))->size();
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QFile_ungetch(JNIEnv* env, jobject obj, jint arg1)
{
	jint xret = (jint) ((QFile*) QtSupport::getQt(env, obj))->ungetch((int) arg1);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QFile_writeBlock__Ljava_lang_String_2J(JNIEnv* env, jobject obj, jstring data, jlong len)
{
static QCString* _qstring_data = 0;
	jlong xret = (jlong) ((QFile*) QtSupport::getQt(env, obj))->writeBlock((const char*) QtSupport::toCharString(env, data, &_qstring_data), (Q_ULONG) len);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QFile_writeBlock___3B(JNIEnv* env, jobject obj, jbyteArray data)
{
static QByteArray* _qbyteArray_data = 0;
	jlong xret = (jlong) ((QFile*) QtSupport::getQt(env, obj))->writeBlock((const QByteArray&)*(QByteArray*) QtSupport::toQByteArray(env, data, &_qbyteArray_data));
	return xret;
}

