@UpdaterClass.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class UpdaterClass
  4. {
  5. static cchar8 *TutorialsProjID;
  6. static const int MaxDownloadAttempts;
  7. static bool CreateFailedDownload(int &failed, C Str &file, ptr user);
  8. bool ready, show, has_update;
  9. Thread thread;
  10. Patcher patcher;
  11. Str path, update_path;
  12. Memc<Patcher::LocalFile> local_files;
  13. Memc<int> local_remove;
  14. Map<Str, int> failed_download; // doesn't need to be thread-safe
  15. static FILE_LIST_MODE Filter(C FileFind &ff, UpdaterClass &updater);
  16. static FILE_LIST_MODE FilterUpdate(C FileFind &ff, UpdaterClass &updater);
  17. static FILE_LIST_MODE HasUpdate(C FileFind &ff, UpdaterClass &updater);
  18. bool hasUpdate();
  19. bool updating();
  20. flt progress();
  21. static bool Update(Thread &thread);
  22. bool update(); // !! this is called on secondary thread !!
  23. void create();
  24. void del();
  25. ~UpdaterClass(); // to manually delete the thread before other members
  26. public:
  27. UpdaterClass();
  28. };
  29. /******************************************************************************/
  30. /******************************************************************************/
  31. extern UpdaterClass Updater;
  32. /******************************************************************************/