author | insilmaril |
Wed, 25 Apr 2007 16:02:54 +0000 | |
changeset 463 | 694f5e35e87c |
parent 408 | c2a05fa925a1 |
child 475 | 0f8879937035 |
permissions | -rw-r--r-- |
1 #ifndef OPTIONS_H
2 #define OPTIONS_H
4 #include <QStringList>
6 enum OptionType {SwitchOption,StringOption};
8 class Option
9 {
10 public:
11 Option();
12 Option(const QString &, const OptionType &, const QString &, const QString &);
13 void set (const QString &, const OptionType &, const QString &, const QString &);
14 QString getName();
15 QString getShort();
16 QString getLong();
17 OptionType getType();
18 void setArg(const QString &);
19 QString getArg();
20 void setActive();
21 bool isActive();
22 private:
23 QString name;
24 OptionType type;
25 QString sName;
26 QString lName;
27 QString sarg;
28 bool active;
29 };
32 class Options
33 {
34 public:
35 Options();
36 int parse();
37 void add (Option );
38 void add (const QString &,const OptionType &, const QString &, const QString&);
39 void setHelpText(const QString&);
40 QString getHelpText();
41 QString getProgramName();
42 QStringList getFileList();
43 bool isOn (const QString &);
44 QString getArg (const QString &);
46 private:
47 QString progname;
48 QString helptext;
49 QStringList filelist;
50 QList <Option> optlist;
51 };
53 #endif