diff -r c2a05fa925a1 -r 7fc6541f0490 options.h --- a/options.h Fri Dec 08 20:18:56 2006 +0000 +++ b/options.h Mon Jul 23 12:42:01 2007 +0000 @@ -3,25 +3,30 @@ #include -enum OptionType {SwitchOption,StringOption}; - +/*! \brief A single option which is listed in Options */ class Option { public: + /*! Types of options */ + enum Type { + Switch, //!< No paramater + String //!< Parameter is a string + }; + Option(); - Option(const QString &, const OptionType &, const QString &, const QString &); - void set (const QString &, const OptionType &, const QString &, const QString &); + Option(const QString &, const Type &, const QString &, const QString &); + void set (const QString &, const Type &, const QString &, const QString &); QString getName(); QString getShort(); QString getLong(); - OptionType getType(); + Type getType(); void setArg(const QString &); QString getArg(); void setActive(); bool isActive(); private: QString name; - OptionType type; + Type type; QString sName; QString lName; QString sarg; @@ -29,13 +34,15 @@ }; +/*! \brief Simple class to deal with command line options */ + class Options { public: Options(); int parse(); void add (Option ); - void add (const QString &,const OptionType &, const QString &, const QString&); + void add (const QString &,const Option::Type &, const QString &, const QString&); void setHelpText(const QString&); QString getHelpText(); QString getProgramName();