1 /***************************************************************************
2 * Copyright (C) 2007 by Tobias Koenig <tokoe@kde.org> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
13 #include <QtCore/QObject>
14 #include <QtCore/QProcess>
15 #include <QtCore/QStringList>
21 class Unrar
: public QObject
27 * Creates a new unrar object.
32 * Destroys the unrar object.
37 * Opens given rar archive.
39 bool open( const QString
&fileName
);
42 * Returns the list of files from the archive.
47 * Returns the content of the file with the given name.
49 QByteArray
contentOf( const QString
&fileName
) const;
52 * Returns a new device for reading the file with the given name.
54 QIODevice
* createDevice( const QString
&fileName
) const;
56 static bool isAvailable();
57 static bool isSuitableVersionAvailable();
60 void readFromStdout();
61 void readFromStderr();
62 void finished( int exitCode
, QProcess::ExitStatus exitStatus
);
65 int startSyncProcess( const QStringList
&args
);
66 void writeToProcess( const QByteArray
&data
);
71 KPtyProcess
*mProcess
;
75 QByteArray mStdOutData
;
76 QByteArray mStdErrData
;