CLIProcessor.hpp   CLIProcessor.hpp 
skipping to change at line 31 skipping to change at line 31
#define CLIPROCESSOR_HPP #define CLIPROCESSOR_HPP
#include <QStringList> #include <QStringList>
class QSettings; class QSettings;
class CLIProcessor class CLIProcessor
{ {
public: public:
//! Check if a QStringList has a CLI-style option in it (before the first --). //! Check if a QStringList has a CLI-style option in it (before the first --).
//! @param args a list of strings, think argv //! @param argList a list of strings, think argv
//! @param shortOpt a short-form option string, e.g, "-h" //! @param shortOpt a short-form option string, e.g, "-h"
//! @param longOpt a long-form option string, e.g. "--help" //! @param longOpt a long-form option string, e.g. "--help"
//! @return true if the option exists in args before any element whi ch is "--" //! @return true if the option exists in args before any element whi ch is "--"
static bool argsGetOption(const QStringList& argList, QString shortO pt, QString longOpt); static bool argsGetOption(const QStringList& argList, QString shortO pt, QString longOpt);
//! Retrieve the argument to an option from a QStringList. //! Retrieve the argument to an option from a QStringList.
//! Given a list of strings, this function will extract the argument of //! Given a list of strings, this function will extract the argument of
//! type T to an option, where the option in an element which matche s //! type T to an option, where the option in an element which matche s
//! either the short or long forms, and the argument to that option //! either the short or long forms, and the argument to that option
//! is the following element in the list, e.g. ("--option", "arg"). //! is the following element in the list, e.g. ("--option", "arg").
//! It is also possible to extract argument to options which are //! It is also possible to extract argument to options which are
//! part of the option element, separated by the "=" character, e.g. //! part of the option element, separated by the "=" character, e.g.
//! ( "--option=arg" ). //! ( "--option=arg" ).
//! Type conversion is done using the QTextStream class, and as such //! Type conversion is done using the QTextStream class, and as such
//! possible types which this template function may use are restrict ed //! possible types which this template function may use are restrict ed
//! to those where there is a value operator<<() defined in the //! to those where there is a value operator<<() defined in the
//! QTextStream class for that type. //! QTextStream class for that type.
//! The argument list is only processed as far as the first value "- -". //! The argument list is only processed as far as the first value "- -".
//! If an argument "--" is to be retrieved, it must be apecified usi ng //! If an argument "--" is to be retrieved, it must be apecified usi ng
//! the "--option=--" form. //! the "--option=--" form.
//! @param args a list of strings, think argv. //! @param argList a list of strings, think argv.
//! @param shortOpt the short form of the option, e.g. "-n". //! @param shortOpt the short form of the option, e.g. "-n".
//! @param longOpt the long form of the option, e.g. "--number". //! @param longOpt the long form of the option, e.g. "--number".
//! @param defaultValue the default value to return if the option wa s //! @param defaultValue the default value to return if the option wa s
//! not found in args. //! not found in args.
//! @exception runtime_error("no_optarg") the expected argument to t he //! @exception runtime_error("no_optarg") the expected argument to t he
//! option was not found. //! option was not found.
//! @exception runtime_error("optarg_type") the expected argument to //! @exception runtime_error("optarg_type") the expected argument to
//! the option could not be converted. //! the option could not be converted.
//! @return The value of the argument to the specified option which //! @return The value of the argument to the specified option which
//! occurs before the first element with the value "--". If the opt ion //! occurs before the first element with the value "--". If the opt ion
//! is not found, defaultValue is returned. //! is not found, defaultValue is returned.
static QVariant argsGetOptionWithArg(const QStringList& argList, QSt ring shortOpt, QString longOpt, QVariant defaultValue); static QVariant argsGetOptionWithArg(const QStringList& argList, QSt ring shortOpt, QString longOpt, QVariant defaultValue);
//! Check if a QStringList has a yes/no CLI-style option in it, and //! Check if a QStringList has a yes/no CLI-style option in it, and
//! find out the argument to that parameter. //! find out the argument to that parameter.
//! e.g. option --use-foo can have parameter "yes" or "no" //! e.g. option --use-foo can have parameter "yes" or "no"
//! It is also possible for the argument to take values, "1", "0"; //! It is also possible for the argument to take values, "1", "0";
//! "true", "false"; //! "true", "false";
//! @param args a list of strings, think argv //! @param argList a list of strings, think argv
//! @param shortOpt a short-form option string, e.g, "-h" //! @param shortOpt a short-form option string, e.g, "-h"
//! @param longOpt a long-form option string, e.g. "--help" //! @param longOpt a long-form option string, e.g. "--help"
//! @param defaultValue the default value to return if the option wa s //! @param defaultValue the default value to return if the option wa s
//! not found in args. //! not found in args.
//! @exception runtime_error("no_optarg") the expected argument to t he //! @exception runtime_error("no_optarg") the expected argument to t he
//! option was not found. The longOpt value is appended in parenthes is. //! option was not found. The longOpt value is appended in parenthes is.
//! @exception runtime_error("optarg_type") the expected argument to //! @exception runtime_error("optarg_type") the expected argument to
//! the option could not be converted. The longOpt value is appended //! the option could not be converted. The longOpt value is appended
//! in parenthesis. //! in parenthesis.
//! @return 1 if the argument to the specified opion is "yes", "y", //! @return 1 if the argument to the specified opion is "yes", "y",
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/