source: trunk/gsinstaller/unInstall.h@ 1537

Last change on this file since 1537 was 1536, checked in by sjboddie, 24 years ago

Changes to get compiling on VC++ and gcc

  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 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
10#if defined (GSDL_USE_IOS_H)
11#include <fstream.h>
12#else
13#include <fstream>
14#endif
15
16#include "stringArray.h"
17
18static string uninstall_ALL = "all";
19
20typedef class unInstallCommand
21{
22public:
23 string command;
24 stringArray parameters;
25
26 unInstallCommand() { };
27 unInstallCommand(string commandname) { this->command = commandname; };
28 unInstallCommand(string commandname, stringArray params)
29 {
30 this->command = commandname;
31 this->parameters = params;
32 };
33 void addParameter(string parameter) { this->parameters.add(parameter); };
34 string commandName() { return this->command; };
35 stringArray &parameterList() { return this->parameters; };
36} unInstallCommand;
37
38typedef vector<unInstallCommand> unInstallCommandList;
39
40typedef map<string, unInstallCommandList, less<string> > unInstallCommandMap;
41
42class installManager
43{
44private:
45 fstream logfile;
46 string logfileName;
47 string currentModule;
48 unInstallCommandMap modules;
49
50 bool writeString(string str);
51 bool writeString(char *string);
52 bool writeSeparator();
53 string readString();
54 bool writeCommand(unInstallCommand &command);
55 string readCommand(stringArray &params);
56public:
57 installManager() { };
58 bool openLog(string filename, bool write);
59 bool closeLog();
60 bool reopenLog();
61 void setModule(string moduleName);
62 bool storeCommand(unInstallCommand &command);
63 string popCommand(stringArray &params);
64 bool isEmpty();
65 ~installManager();
66};
67
68class installAgent
69{
70protected:
71 installManager *manager;
72public:
73 installAgent(installManager &useManager) { this->manager = &useManager; };
74 virtual bool undoAction(string actionName, stringArray &params) { return false; };
75 // bool undo(string actionName);
76};
77
78#endif
Note: See TracBrowser for help on using the repository browser.