# HG changeset patch # User insilmaril # Date 1177516974 0 # Node ID 0f8879937035d3c587470e968fc6cb51910d870f # Parent d9add21ee9d3ea6a8b1ba28b9fdcffad391ebd8b started doxygen documentation diff -r d9add21ee9d3 -r 0f8879937035 options.h --- a/options.h Wed Apr 25 16:02:54 2007 +0000 +++ b/options.h Wed Apr 25 16:02:54 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();