author | insilmaril |
Mon Apr 10 11:00:46 2006 +0000 (2006-04-10) | |
changeset 272 | a83b6cec9428 |
child 2 | 608f976aa7bb |
permissions | -rw-r--r-- |
insilmaril@0 | 1 |
#ifndef OPTIONS_H |
insilmaril@0 | 2 |
#define OPTIONS_H |
insilmaril@0 | 3 |
|
insilmaril@0 | 4 |
#include <qstring.h> |
insilmaril@0 | 5 |
#include <qstringlist.h> |
insilmaril@0 | 6 |
|
insilmaril@0 | 7 |
enum OptionType {SwitchOption,StringOption}; |
insilmaril@0 | 8 |
|
insilmaril@0 | 9 |
class Option |
insilmaril@0 | 10 |
{ |
insilmaril@0 | 11 |
public: |
insilmaril@0 | 12 |
Option(); |
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 |
|
insilmaril@0 | 33 |
typedef QValueList <Option> OptionList; |
insilmaril@0 | 34 |
|
insilmaril@0 | 35 |
class Options |
insilmaril@0 | 36 |
{ |
insilmaril@0 | 37 |
public: |
insilmaril@0 | 38 |
Options(); |
insilmaril@0 | 39 |
int parse(); |
insilmaril@0 | 40 |
void add (const QString &,const OptionType &, const QString &, const QString&); |
insilmaril@0 | 41 |
void setHelpText(const QString&); |
insilmaril@0 | 42 |
QString getHelpText(); |
insilmaril@0 | 43 |
QString getProgramName(); |
insilmaril@0 | 44 |
QStringList getFileList(); |
insilmaril@0 | 45 |
bool isOn (const QString &); |
insilmaril@0 | 46 |
QString getArg (const QString &); |
insilmaril@0 | 47 |
|
insilmaril@0 | 48 |
private: |
insilmaril@0 | 49 |
QString progname; |
insilmaril@0 | 50 |
QString helptext; |
insilmaril@0 | 51 |
QStringList filelist; |
insilmaril@0 | 52 |
OptionList optlist; |
insilmaril@0 | 53 |
}; |
insilmaril@0 | 54 |
|
insilmaril@0 | 55 |
#endif |