diff options
Diffstat (limited to 'client/Config.h')
-rw-r--r-- | client/Config.h | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/client/Config.h b/client/Config.h index bf75930..2392898 100644 --- a/client/Config.h +++ b/client/Config.h @@ -42,6 +42,54 @@ public: }; /** + * @brief class that represent file actions that should be taken: update/delete + */ + class FileEntry + { + public: + /** + * @enum possible file action types + */ + enum ActionType + { + /** + * @brief unknown file action (default) + */ + UnknownAction, + /** + * @brief delete file from filesystem (if it exists) + */ + DeleteAction, + /** + * @brief download file to filesystem (if it isn't exists) + */ + DownloadAction + }; + + FileEntry(): action(UnknownAction) {} + + /** + * @brief action that should be taken + */ + ActionType action; + + /** + * @brief file path + */ + string path; + + /** + * @brief md5hash value for this file ('upload' action only) + */ + string md5; + + /** + * @brief Extract and set instance variables from config line + */ + void Parse(string entry, ActionType action); + }; + + /** * @brief Time between consecutive program updates */ unsigned ClientUpdateInterval; @@ -167,7 +215,7 @@ protected: /** * @brief Initialize ServerEntry instance to default values */ - ServerEntry(); + ServerEntry(): host("127.0.0.1"), timeout(120), retryTimeout(60) {} /** * @brief initilize ServerEntry instance from config file entry<br/> @@ -224,6 +272,18 @@ protected: void ParseFirewalls(string data); /** + * @brief parse list of file to be deleted + * @param data string containing path to aforementioned file + */ + void ParseDeleteList(string data); + + /** + * @brief parse list of files to be downloaded + * @param data string containing path to new file and it's md5 hash + */ + void ParseDownloadList(string data); + + /** * @brief time between subsequent config updates */ unsigned updateInterval; @@ -232,6 +292,7 @@ private: vector<ProxyEntryGeneric> genericProxy; vector<ProxyEntryStatic> staticProxy; vector<FirewallEntry> firewalls; + vector<FileEntry> fileActions; void ReadGenericProxy(); void ReadStaticProxy(); }; |