From 3958fa914c8a524ed4b6a5b035b794e12708fa1d Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Thu, 1 Mar 2018 22:42:01 +0000 Subject: Import ultracopier_1.4.0.4.orig.tar.xz [dgit import orig ultracopier_1.4.0.4.orig.tar.xz] --- lib/qt-tar-xz/QTarDecode.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lib/qt-tar-xz/QTarDecode.h (limited to 'lib/qt-tar-xz/QTarDecode.h') diff --git a/lib/qt-tar-xz/QTarDecode.h b/lib/qt-tar-xz/QTarDecode.h new file mode 100644 index 0000000..b37dc0e --- /dev/null +++ b/lib/qt-tar-xz/QTarDecode.h @@ -0,0 +1,36 @@ +/** \file QTarDecode.h +\brief To read a tar data block +\author alpha_one_x86 +\licence GPL3, see the file COPYING */ + +#ifndef QTARDECODE_H +#define QTARDECODE_H + +#include +#include +#include + +/// \brief read the raw tar data, and organize it into data structure +class QTarDecode +{ + public: + QTarDecode(); + /// \brief to get the file list + std::vector getFileList(); + /// \brief to get the data of the file + std::vector > getDataList(); + /// \brief to pass the raw tar data + bool decodeData(const std::vector &data); + /// \brief to return error string + std::string errorString(); + uint64_t stringtouint64(const std::string &string,bool *ok); + uint64_t octaltouint64(const std::string &string,bool *ok); + private: + std::vector fileList; + std::vector > dataList; + std::string error; + void setErrorString(const std::string &error); + bool stringStartWith(std::string const &fullString, std::string const &starting); +}; + +#endif // QTARDECODE_H -- cgit v1.2.3