Public Types | Public Member Functions | Static Public Member Functions

Option Class Reference
[Global code used by all commands]

Argument info. More...

#include <optionmanager.hpp>

List of all members.

Public Types

enum  ArgValueType { Flag, String, Int }

Public Member Functions

 Option (QString description=QString(), ArgValueType valueType=Option::Flag, QVariant value=QVariant(), QString longName=QString())
 Initialize with the given values.
void clear ()
 Clears the value.
QString description () const
bool isFlag () const
QString longName () const
bool parseValue (const QString &strValue)
 Stores the given value in the right type.
bool setFlag (bool set=true)
 Sets the option flag to true.
QVariant value () const
QString valueTypeString () const

Static Public Member Functions

static bool isLongNameValid (const QString &name)
static bool isNameValid (const QChar &name)

Detailed Description

Argument info.


Member Enumeration Documentation

Enumerator:
Flag 

Option is a flag with boolean value.

String 
Int 

Constructor & Destructor Documentation

Option::Option ( QString  description = QString(),
ArgValueType  valueType = Option::Flag,
QVariant  value = QVariant(),
QString  longName = QString() 
)

Initialize with the given values.


Member Function Documentation

void Option::clear (  ) 

Clears the value.

QString Option::description (  )  const
bool Option::isFlag (  )  const
bool Option::isLongNameValid ( const QString &  name  )  [static]
bool Option::isNameValid ( const QChar &  name  )  [static]
QString Option::longName (  )  const
bool Option::parseValue ( const QString &  strValue  ) 

Stores the given value in the right type.

Returns:
False if the option does not have a value or if the string can't be parsed, true otherwise.
bool Option::setFlag ( bool  set = true  ) 

Sets the option flag to true.

Returns:
False if the option is not flag type, true otherwise.
QVariant Option::value (  )  const
QString Option::valueTypeString (  )  const
All Classes Functions Variables Typedefs Enumerations Enumerator