TDME2  1.9.200
Installer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 #include <vector>
6 
7 #include <tdme/tdme.h>
9 #include <tdme/engine/fwd-tdme.h>
17 
18 using std::string;
19 using std::unique_ptr;
20 using std::vector;
21 
31 
32 /**
33  * Installer
34  * @author Andreas Drewke
35  */
37  : public virtual Application, public virtual GUIActionListener, public virtual GUIChangeListener
38 {
39 private:
40  Engine* engine { nullptr };
41  unique_ptr<PopUps> popUps;
45  volatile Screen screen;
47  string homeFolder;
49  bool installed;
50  string timestamp;
52  vector<string> downloadedFiles;
53 
54  /**
55  * Mount installer file system
56  */
57  static void mountInstallerFileSystem(const string& timestamp = string(), bool remountInstallerArchive = false);
58 
59  /**
60  * Initialize screens
61  */
62  void initializeScreens();
63 
64  /**
65  * Perform screen action
66  */
67  void performScreenAction();
68 
69  /**
70  * Scan archive file system
71  * @oaram archive archive file system
72  * @param totalFiles total files
73  * @param pathName path name
74  */
75  static void scanArchive(ArchiveFileSystem* archiveFileSystem, vector<string>& totalFiles, const string& pathName = string());
76 
77  /**
78  * Create a path recursively
79  * @param pathName path name
80  */
81  static void createPathRecursively(const string& pathName);
82 public:
83  // forbid class copy
85 
86  /**
87  * Public constructor
88  */
89  Installer();
90 
91  // overridden methods
92  void initialize() override;
93  void dispose() override;
94  void reshape(int width, int height) override;
95  void display() override;
96  void onClose() override;
97  void onAction(GUIActionListenerType type, GUIElementNode* node) override;
98  void onChange(GUIElementNode* node) override;
99 
100  /**
101  * Main
102  * @param argc argument count
103  * @param argv argument values
104  * @return exit code
105  */
106  static int main(int argc, char** argv);
107 
108 };
Application base class, please make sure to allocate application on heap to have correct application ...
Definition: Application.h:41
Engine main class.
Definition: Engine.h:131
Archive file system implementation.
Mutex implementation.
Definition: Mutex.h:19
Pop ups controller accessor class.
Definition: PopUps.h:29
void dispose() override
Disposes.
Definition: Installer.cpp:1134
vector< string > downloadedFiles
Definition: Installer.h:52
void display() override
Display.
Definition: Installer.cpp:1311
static void mountInstallerFileSystem(const string &timestamp=string(), bool remountInstallerArchive=false)
Mount installer file system.
Definition: Installer.cpp:1326
void initialize() override
Init.
Definition: Installer.cpp:1108
static int main(int argc, char **argv)
Main.
Definition: Installer.cpp:1380
void onChange(GUIElementNode *node) override
On change.
Definition: Installer.cpp:1307
static void createPathRecursively(const string &pathName)
Create a path recursively.
Definition: Installer.cpp:1417
void initializeScreens()
Initialize screens.
Definition: Installer.cpp:117
Installer()
Public constructor.
Definition: Installer.cpp:105
void reshape(int width, int height) override
Resize.
Definition: Installer.cpp:1139
void onAction(GUIActionListenerType type, GUIElementNode *node) override
Definition: Installer.cpp:1144
unique_ptr< PopUps > popUps
Definition: Installer.h:41
void onClose() override
On close.
Definition: Installer.cpp:1435
static void scanArchive(ArchiveFileSystem *archiveFileSystem, vector< string > &totalFiles, const string &pathName=string())
Scan archive file system @oaram archive archive file system.
Definition: Installer.cpp:1404
void performScreenAction()
Perform screen action.
Definition: Installer.cpp:270
Properties class, which helps out with storeing or loading key value pairs from/to property files.
Definition: Properties.h:23
GUI action listener interface.
GUI change listener interface.
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6