author | insilmaril |
Sun Jan 30 12:59:03 2005 +0000 (2005-01-30) | |
branch | vendor |
changeset 28 | 512536ce7773 |
child 2 | 608f976aa7bb |
permissions | -rw-r--r-- |
1 #ifndef OPTIONS_H
2 #define OPTIONS_H
4 #include <qstring.h>
5 #include <qstringlist.h>
7 enum OptionType {SwitchOption,StringOption};
9 class Option
10 {
11 public:
12 Option();
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 };
33 typedef QValueList <Option> OptionList;
35 class Options
36 {
37 public:
38 Options();
39 int parse();
40 void add (const QString &,const OptionType &, const QString &, const QString&);
41 void setHelpText(const QString&);
42 QString getHelpText();
43 QString getProgramName();
44 QStringList getFileList();
45 bool isOn (const QString &);
46 QString getArg (const QString &);
48 private:
49 QString progname;
50 QString helptext;
51 QStringList filelist;
52 OptionList optlist;
53 };
55 #endif