/***************************************************************************
                            kde_KTar.cpp -  description
                             -------------------
    begin                : Wed Feb  6 15:12:26 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Feb  6 15:12:26 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

extern "C" {
#include "kde_KTar.h"
}

#include <ktar.h>

class KTarBridge : public KTar
{
public:
	KTarBridge(const QString& filename, const QString& mimetype) : KTar(filename, mimetype) {}
	KTarBridge(QIODevice* dev) : KTar(dev) {}
	~KTarBridge() {}
	 bool  protected_openArchive(int mode) {
		return ( bool ) KTar::openArchive(mode);
	}
	 bool  protected_closeArchive() {
		return ( bool ) KTar::closeArchive();
	}
};

kde_KTar * kde_new_KTar(qt_QString * filename, qt_QString * mimetype){
	return (kde_KTar *) new KTarBridge((QString&)* (QString*)filename, (QString&)* (QString*)mimetype);
}
kde_KTar * kde_new_KTar1(qt_QIODevice * dev){
	return (kde_KTar *) new KTarBridge((QIODevice*)dev);
}
void kde_del_KTar( kde_KTar* p ){
	delete (KTarBridge*) p;
}
qt_QString * kde_KTar_fileName( kde_KTar* instPointer){
	return (qt_QString *)new QString(((KTarBridge*)instPointer)->fileName());
}
void kde_KTar_setOrigFileName( kde_KTar* instPointer,qt_QCString* fileName){
	((KTarBridge*)instPointer)->setOrigFileName((QCString&)* (QCString*)fileName);
	return;
}
int kde_KTar_writeDir( kde_KTar* instPointer,qt_QString * name, qt_QString * user, qt_QString * group){
	return (int) ((KTarBridge*)instPointer)->writeDir((QString&)* (QString*)name, (QString&)* (QString*)user, (QString&)* (QString*)group);
}
int kde_KTar_prepareWriting( kde_KTar* instPointer,qt_QString * name, qt_QString * user, qt_QString * group, unsigned int size){
	return (int) ((KTarBridge*)instPointer)->prepareWriting((QString&)* (QString*)name, (QString&)* (QString*)user, (QString&)* (QString*)group, (uint)size);
}
int kde_KTar_doneWriting( kde_KTar* instPointer,unsigned int size){
	return (int) ((KTarBridge*)instPointer)->doneWriting((uint)size);
}
int kde_KTar_openArchive( kde_KTar* instPointer,int mode){
	return (int) ((KTarBridge*)instPointer)->protected_openArchive((int)mode);
}
int kde_KTar_closeArchive( kde_KTar* instPointer){
	return (int) ((KTarBridge*)instPointer)->protected_closeArchive();
}
