fileprepare.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef FILEPREPARE_H
  2. #define FILEPREPARE_H
  3. #include <QtCore>
  4. #include "SNCCore_global.h"
  5. #define TXT_FILE_LIMIT 13 //TXT file must limit 13M
  6. #define ZIP_FILE_LIMIT 4 //ZIP file must limit 4M
  7. #define SEG_FILE_LIMIT 1 //SEG file must limit 1M
  8. class SNCCORESHARED_EXPORT FilePrepare
  9. {
  10. public:
  11. FilePrepare(QString fileName, QString fileType, bool isMulti, QString moduleID, QString clientID);
  12. bool prepare();
  13. QString getRtnMsg();
  14. QString getLastUploadFileName();
  15. int getCount();
  16. private:
  17. bool chkFileInfo();
  18. bool chkNumbers();
  19. bool extractNumberFromTxtFile(QStringList fileNames);
  20. bool extractSegmentFromTxtFile(QStringList fileNames);
  21. bool zipFile();
  22. bool unzipFile();
  23. private:
  24. QString oriFileName;
  25. QStringList txtFileNames;
  26. QString zipFileName;
  27. bool isZipFile;
  28. bool isMulti;
  29. QString fileType;
  30. QFileInfo fileInfo;
  31. QString rtnMsg;
  32. int count;
  33. QStringList numbers;
  34. QStringList segments;
  35. int minNumbers;
  36. int maxNumbers;
  37. QString moduleID;
  38. QString clientID;
  39. QString m_tempPath;
  40. };
  41. #endif // FILEPREPARE_H