Public Types | Public Member Functions | Protected Member Functions | Private Member Functions

ctkVTKCommandOptions Class Reference

#include <Libs/Visualization/VTK/Core/ctkVTKCommandOptions.h>

List of all members.

Public Types

enum  { ALL = 0, QSETTINGS_ONLY = 0x1 }

Public Member Functions

 ctkVTKCommandOptions (QSettings *_settings)
 Constructors.
bool disableSettings () const
QString errorMessage () const
QString help ()
bool helpSelected () const
QStringList ignoredArguments () const
bool ignoreRest () const
int indexOfLastParsedArgument ()
bool parse (int argc, const char *const argv[])
virtual void printAdditionalInfo ()
int processType () const
QStringList remainingArguments ()
void remainingArguments (int *argc, char ***argv)
void setProcessType (int p)
QSettings * settings () const
QString unknownArgument () const
virtual ~ctkVTKCommandOptions ()

Protected Member Functions

void addArgument (const char *longarg, const char *shortarg, int *var, const char *arghelp, int defaultValue=0, int type=ALL)
void addArgument (const char *longarg, const char *shortarg, QString *var, const char *arghelp, const QString &defaultValue=QString(), int type=ALL)
void addArgument (const char *longarg, const char *shortarg, QStringList *var, const char *arghelp, const QStringList &defaultValue=QStringList(), int type=ALL)
void addBooleanArgument (const char *longarg, const char *shortarg, bool *var, const char *arghelp, bool defaultValue=false, int type=ALL)
void addDeprecatedArgument (const char *longarg, const char *shortarg, const char *arghelp, int type=ALL)
virtual bool deprecatedArgument (const char *argument)
virtual void disableCurrentSettings ()=0
 Disable current settings.
virtual void initialize ()
 Initialize arguments.
virtual bool postProcess (int argc, const char *const *argv)
virtual bool wrongArgument (const char *argument)

Private Member Functions

 CTK_DECLARE_PRIVATE (ctkVTKCommandOptions)

Detailed Description

Definition at line 53 of file ctkVTKCommandOptions.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
ALL 
QSETTINGS_ONLY 

Definition at line 62 of file ctkVTKCommandOptions.h.


Constructor & Destructor Documentation

ctkVTKCommandOptions::ctkVTKCommandOptions ( QSettings *  _settings  )  [explicit]

Constructors.

Definition at line 249 of file ctkVTKCommandOptions.cpp.

ctkVTKCommandOptions::~ctkVTKCommandOptions (  )  [virtual]

Definition at line 258 of file ctkVTKCommandOptions.cpp.


Member Function Documentation

void ctkVTKCommandOptions::addArgument ( const char *  longarg,
const char *  shortarg,
int *  var,
const char *  arghelp,
int  defaultValue = 0,
int  type = ALL 
) [protected]

Definition at line 484 of file ctkVTKCommandOptions.cpp.

void ctkVTKCommandOptions::addArgument ( const char *  longarg,
const char *  shortarg,
QString *  var,
const char *  arghelp,
const QString &  defaultValue = QString(),
int  type = ALL 
) [protected]

Definition at line 435 of file ctkVTKCommandOptions.cpp.

void ctkVTKCommandOptions::addArgument ( const char *  longarg,
const char *  shortarg,
QStringList *  var,
const char *  arghelp,
const QStringList &  defaultValue = QStringList(),
int  type = ALL 
) [protected]

Definition at line 459 of file ctkVTKCommandOptions.cpp.

void ctkVTKCommandOptions::addBooleanArgument ( const char *  longarg,
const char *  shortarg,
bool *  var,
const char *  arghelp,
bool  defaultValue = false,
int  type = ALL 
) [protected]

Add a command line argument. For each argument added there is a long version --long and a short version -l, a help string, and a variable that is set to the value of the option. The types can be int, QString, boolean (set to 1 if argument is present) or QStringList. Also deprecated arguments can be added with only a help string. The help string should say that the argument is deprecated and suggest the alternative argument to use.

Definition at line 406 of file ctkVTKCommandOptions.cpp.

void ctkVTKCommandOptions::addDeprecatedArgument ( const char *  longarg,
const char *  shortarg,
const char *  arghelp,
int  type = ALL 
) [protected]

Definition at line 368 of file ctkVTKCommandOptions.cpp.

ctkVTKCommandOptions::CTK_DECLARE_PRIVATE ( ctkVTKCommandOptions   )  [private]
bool ctkVTKCommandOptions::deprecatedArgument ( const char *  argument  )  [protected, virtual]

This method is called when a deprecated argument is found. If it returns False, then the parsing will fail.

Definition at line 391 of file ctkVTKCommandOptions.cpp.

virtual void ctkVTKCommandOptions::disableCurrentSettings (  )  [protected, pure virtual]

Disable current settings.

bool ctkVTKCommandOptions::disableSettings (  )  const

Should user settings be considered ?

QString ctkVTKCommandOptions::errorMessage (  )  const

Get the error message if Parse returned 0.

QString ctkVTKCommandOptions::help (  ) 

Definition at line 292 of file ctkVTKCommandOptions.cpp.

bool ctkVTKCommandOptions::helpSelected (  )  const

Was help selected?

QStringList ctkVTKCommandOptions::ignoredArguments (  )  const

If any, return the list of ignored arguments

bool ctkVTKCommandOptions::ignoreRest (  )  const

Return True if flag '--ignore-rest' has been specified

int ctkVTKCommandOptions::indexOfLastParsedArgument (  ) 

Get the index of the last parsed argument.

Definition at line 507 of file ctkVTKCommandOptions.cpp.

void ctkVTKCommandOptions::initialize (  )  [protected, virtual]

Initialize arguments.

Definition at line 287 of file ctkVTKCommandOptions.cpp.

bool ctkVTKCommandOptions::parse ( int  argc,
const char *const   argv[] 
)

Parse the arguments

Definition at line 306 of file ctkVTKCommandOptions.cpp.

bool ctkVTKCommandOptions::postProcess ( int  argc,
const char *const *  argv 
) [protected, virtual]

After parsing, process extra option dependencies.

Definition at line 300 of file ctkVTKCommandOptions.cpp.

void ctkVTKCommandOptions::printAdditionalInfo (  )  [virtual]

Definition at line 263 of file ctkVTKCommandOptions.cpp.

int ctkVTKCommandOptions::processType (  )  const

Set/Get the type of the process for this set of options. GUI application, Batch, Daemon, etc ...

void ctkVTKCommandOptions::remainingArguments ( int *  argc,
char ***  argv 
)

Definition at line 360 of file ctkVTKCommandOptions.cpp.

QStringList ctkVTKCommandOptions::remainingArguments (  ) 

If parse return False, this function will return the unparsed arguments

Definition at line 348 of file ctkVTKCommandOptions.cpp.

void ctkVTKCommandOptions::setProcessType ( int  p  ) 
QSettings* ctkVTKCommandOptions::settings (  )  const

Convenient method to get associated Settings object

QString ctkVTKCommandOptions::unknownArgument (  )  const

In case of unknown argument, return its name.

bool ctkVTKCommandOptions::wrongArgument ( const char *  argument  )  [protected, virtual]

This method is called when wrong argument is found. If it returns False, then the parsing will fail.

Definition at line 399 of file ctkVTKCommandOptions.cpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines