insilmaril@0
|
1 |
#ifndef OPTIONS_H
|
insilmaril@0
|
2 |
#define OPTIONS_H
|
insilmaril@0
|
3 |
|
insilmaril@408
|
4 |
#include <QStringList>
|
insilmaril@0
|
5 |
|
insilmaril@0
|
6 |
enum OptionType {SwitchOption,StringOption};
|
insilmaril@0
|
7 |
|
insilmaril@0
|
8 |
class Option
|
insilmaril@0
|
9 |
{
|
insilmaril@0
|
10 |
public:
|
insilmaril@0
|
11 |
Option();
|
insilmaril@408
|
12 |
Option(const QString &, const OptionType &, const QString &, const QString &);
|
insilmaril@0
|
13 |
void set (const QString &, const OptionType &, const QString &, const QString &);
|
insilmaril@0
|
14 |
QString getName();
|
insilmaril@0
|
15 |
QString getShort();
|
insilmaril@0
|
16 |
QString getLong();
|
insilmaril@0
|
17 |
OptionType getType();
|
insilmaril@0
|
18 |
void setArg(const QString &);
|
insilmaril@0
|
19 |
QString getArg();
|
insilmaril@0
|
20 |
void setActive();
|
insilmaril@0
|
21 |
bool isActive();
|
insilmaril@0
|
22 |
private:
|
insilmaril@0
|
23 |
QString name;
|
insilmaril@0
|
24 |
OptionType type;
|
insilmaril@0
|
25 |
QString sName;
|
insilmaril@0
|
26 |
QString lName;
|
insilmaril@0
|
27 |
QString sarg;
|
insilmaril@0
|
28 |
bool active;
|
insilmaril@0
|
29 |
};
|
insilmaril@0
|
30 |
|
insilmaril@0
|
31 |
|
insilmaril@0
|
32 |
class Options
|
insilmaril@0
|
33 |
{
|
insilmaril@0
|
34 |
public:
|
insilmaril@0
|
35 |
Options();
|
insilmaril@0
|
36 |
int parse();
|
insilmaril@408
|
37 |
void add (Option );
|
insilmaril@0
|
38 |
void add (const QString &,const OptionType &, const QString &, const QString&);
|
insilmaril@0
|
39 |
void setHelpText(const QString&);
|
insilmaril@0
|
40 |
QString getHelpText();
|
insilmaril@0
|
41 |
QString getProgramName();
|
insilmaril@0
|
42 |
QStringList getFileList();
|
insilmaril@0
|
43 |
bool isOn (const QString &);
|
insilmaril@0
|
44 |
QString getArg (const QString &);
|
insilmaril@0
|
45 |
|
insilmaril@0
|
46 |
private:
|
insilmaril@0
|
47 |
QString progname;
|
insilmaril@0
|
48 |
QString helptext;
|
insilmaril@0
|
49 |
QStringList filelist;
|
insilmaril@408
|
50 |
QList <Option> optlist;
|
insilmaril@0
|
51 |
};
|
insilmaril@0
|
52 |
|
insilmaril@0
|
53 |
#endif
|