source: trunk/gsinstaller/unInstall.h@ 1539

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

Got compiling on VC++ 4.2

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