#ifndef _UNINSTALL_H_ #define _UNINSTALL_H_ #include #include #include using namespace std; #include #include #include "stringArray.h" static string uninstall_ALL = "all"; typedef struct unInstallCommand { string command; stringArray parameters; } unInstallCommand; typedef vector unInstallCommandList; typedef map > unInstallCommandMap; class installManager { private: fstream logfile; string currentModule; public: installManager() { }; bool openLog(string filename, bool write); void setModule(string moduleName); bool writeString(string str); bool writeString(char *string); bool writeSeparator(); string readString(); string readCommand(stringArray ¶ms); ~installManager(); }; class installAgent { protected: installManager *manager; public: installAgent(installManager &useManager) { this->manager = &useManager; }; virtual bool undoAction(string actionName, stringArray ¶ms) { return false; }; // bool undo(string actionName); }; class unInstaller { private: unInstallCommandMap _map; void unInstallGroup(unInstallCommandList &list); bool readFile(string &fileName); bool getLine(char *line, string &groupname); public: unInstaller(string &fileName); unInstaller(const char *fileName); void unInstall(string &listName); bool record(string group, string cmd, string param); bool record(string group, string cmd, int count, ...); bool saveToFile(string filename); bool execCommand(string &command, stringArray ¶ms); }; #endif