source: trunk/gsinstaller/unInstall.h@ 1475

Last change on this file since 1475 was 1475, checked in by cs025, 24 years ago

Updated sources with most of uninstall added

  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1#ifndef _UNINSTALL_H_
2#define _UNINSTALL_H_
3#include <string>
4#include <vector>
5#include <map>
6using namespace std;
7
8#include <stdio.h>
9#include <fstream.h>
10
11#include "stringArray.h"
12
13static string uninstall_ALL = "all";
14
15typedef struct unInstallCommand
16{ string command;
17 stringArray parameters;
18} unInstallCommand;
19
20typedef vector<unInstallCommand> unInstallCommandList;
21
22typedef map<string, unInstallCommandList, less<string> > unInstallCommandMap;
23
24class installManager
25{ private:
26 fstream logfile;
27 string currentModule;
28 public:
29 installManager() { };
30 bool openLog(string filename, bool write);
31 void setModule(string moduleName);
32 bool writeString(string str);
33 bool writeString(char *string);
34 bool writeSeparator();
35 string readString();
36 string readCommand(stringArray &params);
37 ~installManager();
38};
39
40class installAgent
41{ protected:
42 installManager *manager;
43 public:
44 installAgent(installManager &useManager) { this->manager = &useManager; };
45 virtual bool undoAction(string actionName, stringArray &params) { return false; };
46// bool undo(string actionName);
47};
48
49class unInstaller
50{ private:
51 unInstallCommandMap _map;
52 void unInstallGroup(unInstallCommandList &list);
53 bool readFile(string &fileName);
54 bool getLine(char *line, string &groupname);
55 public:
56 unInstaller(string &fileName);
57 unInstaller(const char *fileName);
58 void unInstall(string &listName);
59 bool record(string group, string cmd, string param);
60 bool record(string group, string cmd, int count, ...);
61 bool saveToFile(string filename);
62 bool execCommand(string &command, stringArray &params);
63};
64
65#endif
Note: See TracBrowser for help on using the repository browser.