options.h
changeset 588 bc9ee45be19c
parent 408 c2a05fa925a1
     1.1 --- a/options.h	Fri Dec 08 20:18:56 2006 +0000
     1.2 +++ b/options.h	Sun Aug 26 12:18:31 2007 +0000
     1.3 @@ -3,25 +3,30 @@
     1.4  
     1.5  #include <QStringList>
     1.6  
     1.7 -enum OptionType  {SwitchOption,StringOption};
     1.8 -
     1.9 +/*! \brief A single option which is listed in Options */
    1.10  class Option
    1.11  {
    1.12  public:
    1.13 +	/*! Types of options */
    1.14 +	enum Type  {
    1.15 +		Switch,	//!< No paramater
    1.16 +		String	//!< Parameter is a string
    1.17 +	};
    1.18 +
    1.19  	Option();
    1.20 -	Option(const QString &, const OptionType &, const QString &, const QString &);
    1.21 -	void set (const QString &, const OptionType &, const QString &, const QString &);
    1.22 +	Option(const QString &, const Type &, const QString &, const QString &);
    1.23 +	void set (const QString &, const Type &, const QString &, const QString &);
    1.24  	QString getName();
    1.25  	QString getShort();
    1.26  	QString getLong();
    1.27 -	OptionType getType();
    1.28 +	Type getType();
    1.29  	void setArg(const QString &);
    1.30  	QString getArg();
    1.31  	void setActive();
    1.32  	bool isActive();
    1.33  private:
    1.34  	QString name;
    1.35 -	OptionType type;
    1.36 +	Type type;
    1.37  	QString sName;
    1.38  	QString lName;
    1.39  	QString sarg;
    1.40 @@ -29,13 +34,15 @@
    1.41  };
    1.42  
    1.43  
    1.44 +/*! \brief Simple class to deal with command line options */
    1.45 +
    1.46  class Options
    1.47  {
    1.48  public:
    1.49  	Options();
    1.50  	int parse();
    1.51  	void add (Option );
    1.52 -	void add (const QString &,const OptionType &, const QString &, const QString&);
    1.53 +	void add (const QString &,const Option::Type &, const QString &, const QString&);
    1.54  	void setHelpText(const QString&);
    1.55  	QString getHelpText();
    1.56  	QString getProgramName();