-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcommanddef.h
52 lines (43 loc) · 982 Bytes
/
commanddef.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* commanddef.h
*
* Created on: Feb 24, 2013
* Author: richardparratt
*/
#ifndef COMMANDDEF_H_
#define COMMANDDEF_H_
#include <vector>
using namespace std;
class CommandDef {
public:
CommandDef(const char *option, const char *reqArgs, const char *optArgs,
int numNames, const char * argNames[], const char *sections[],
HtmltailOption *optionClass) {
this->option = option;
this->reqArgs = reqArgs;
this->optArgs = optArgs;
this->argNames = argNames;
if(sections==NULL) {
for(int n=0; n<numNames; n++) {
this->sections.push_back("");
}
}
else {
string lastSection;
for(int n=0; n<numNames; n++) {
if(*sections[n]) {
lastSection = sections[n];
}
this->sections.push_back(lastSection);
}
}
this->optionClass = optionClass;
}
const char *option;
const char *reqArgs;
const char *optArgs;
const char **argNames;
vector <string> sections;
HtmltailOption *optionClass;
};
#endif /* COMMANDDEF_H_ */