JoinFile.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // JoinFile.h
  3. // JOINFILE
  4. //
  5. // Created by mac on 14-11-21.
  6. // Copyright (c) 2014年 mac. All rights reserved.
  7. //
  8. #ifndef __JOINFILE__JoinFile__
  9. #define __JOINFILE__JoinFile__
  10. #include <iostream>
  11. #include <string>
  12. #include <vector>
  13. #include <map>
  14. #endif /* defined(__JOINFILE__JoinFile__) */
  15. /**
  16. * @addtogroup platform
  17. * @{
  18. */
  19. //! @brief Helper class to handle file operations
  20. class JoinFile
  21. {
  22. public:
  23. static JoinFile* getInstance();
  24. virtual ~JoinFile();
  25. unsigned char* getFileData(const char* pszFilePath, const char* pszMode, unsigned long * pSize);
  26. void doJoinFile(const char* pszFromFilePath,const char* pszToFilePath,const char* type,const char* tmpName,const char* projectPath);
  27. void createFileFromConf(const char* projectPath);
  28. void setPackName(const char* packname);
  29. void rc4_crypt(char *key, unsigned char *Data, unsigned long Len);
  30. void test();
  31. void encryptSingleFile(std::string srcPath, std::string dstPath, std::string mode);
  32. protected:
  33. /**
  34. * The default constructor.
  35. */
  36. JoinFile();
  37. static JoinFile* s_sharedJoinFile;
  38. const char * _packname;
  39. };