wcczipper.h 802 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef WCCZIPPER_H
  2. #define WCCZIPPER_H
  3. #include <QStringList>
  4. #include <QThread>
  5. class QuaZip;
  6. class QuaZipFile;
  7. class QFile;
  8. namespace WccNameSpace {
  9. namespace Internal {
  10. class WccZipper : public QThread
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit WccZipper(QObject *parent);
  15. ~WccZipper();
  16. void setFileName(const QString &name);
  17. QString fileName() const;
  18. QString errorMessage() const;
  19. void setFiles(const QStringList &list);
  20. void addFile(const QString &file);
  21. void addFiles(const QStringList &list);
  22. bool createZip();
  23. private:
  24. bool packFiles();
  25. void run();
  26. void cleanup();
  27. QFile *m_realFile;
  28. QuaZip *m_quaZip;
  29. QuaZipFile *m_quaZipFile;
  30. QStringList m_files;
  31. QString m_zipFileName;
  32. QString m_errorMsg;
  33. };
  34. }
  35. }
  36. #endif // WCCZIPPER_H