summaryrefslogtreecommitdiff
path: root/lib/qt-tar-xz/QTarDecode.h
blob: 6e8e5e54c89ff587c569c9aec139bbc7daa37002 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/** \file QTarDecode.h
\brief To read a tar data block
\author alpha_one_x86
\version 0.3
\date 2010
\licence GPL3, see the file COPYING */

#ifndef QTARDECODE_H
#define QTARDECODE_H

#include <QObject>
#include <QList>
#include <QByteArray>
#include <QString>
#include <QStringList>

/// \brief read the raw tar data, and organize it into data structure
class QTarDecode : public QObject
{
	public:
		QTarDecode();
		/// \brief to get the file list
		QStringList getFileList();
		/// \brief to get the data of the file
		QList<QByteArray> getDataList();
		/// \brief to pass the raw tar data
		bool decodeData(QByteArray data);
		/// \brief to return error string
		QString errorString();
	private:
		QStringList fileList;
		QList<QByteArray> dataList;
		QString error;
		void setErrorString(QString error);
};

#endif // QTARDECODE_H