2010-08-01 12:19:21 +00:00
|
|
|
#ifndef AFCFILE_H
|
|
|
|
#define AFCFILE_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include <QIODevice>
|
|
|
|
|
2010-08-01 14:13:27 +00:00
|
|
|
#include <libimobiledevice/afc.h>
|
2010-08-01 12:19:21 +00:00
|
|
|
|
2010-08-01 14:13:27 +00:00
|
|
|
class iMobileDeviceConnection;
|
|
|
|
|
|
|
|
class AfcFile : public QIODevice {
|
2010-08-01 12:19:21 +00:00
|
|
|
Q_OBJECT
|
2010-08-01 14:13:27 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
AfcFile(iMobileDeviceConnection* connection, const QString& path, QObject* parent = 0);
|
|
|
|
~AfcFile();
|
2010-08-01 12:19:21 +00:00
|
|
|
|
|
|
|
// QIODevice
|
|
|
|
void close();
|
|
|
|
bool open(OpenMode mode);
|
|
|
|
bool seek(qint64 pos);
|
2010-08-09 19:24:17 +00:00
|
|
|
qint64 size() const;
|
2010-08-01 12:19:21 +00:00
|
|
|
|
2010-08-01 14:13:27 +00:00
|
|
|
private:
|
2010-08-01 12:19:21 +00:00
|
|
|
// QIODevice
|
|
|
|
qint64 readData(char* data, qint64 max_size);
|
|
|
|
qint64 writeData(const char* data, qint64 max_size);
|
|
|
|
|
2010-08-09 19:24:17 +00:00
|
|
|
iMobileDeviceConnection* connection_;
|
2010-08-01 12:19:21 +00:00
|
|
|
uint64_t handle_;
|
|
|
|
|
2010-08-01 14:13:27 +00:00
|
|
|
QString path_;
|
2010-08-01 12:19:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|