|
MythTV master
|
Parent class for defining application command line parsers. More...
#include <libmythbase/mythcommandlineparser.h>
Public Types | |
| enum class | Result : std::uint8_t { kEnd = 0 , kEmpty = 1 , kOptOnly = 2 , kOptVal = 3 , kCombOptVal = 4 , kArg = 5 , kPassthrough = 6 , kInvalid = 7 } |
Public Member Functions | |
| MythCommandLineParser (QString appname) | |
| Default constructor for MythCommandLineArg class. More... | |
| virtual | ~MythCommandLineParser () |
| virtual void | LoadArguments (void) |
| void | PrintHelp (void) const |
| Print command line option help. More... | |
| QString | GetHelpString (void) const |
| Generate command line option help text. More... | |
| virtual QString | GetHelpHeader (void) const |
| virtual bool | Parse (int argc, const char *const *argv) |
| Loop through argv and populate arguments with values. More... | |
| CommandLineArg * | add (const QString &arg, const QString &name, bool def, QString help, QString longhelp) |
| CommandLineArg * | add (const QString &arg, const QString &name, int def, QString help, QString longhelp) |
| CommandLineArg * | add (const QString &arg, const QString &name, uint def, QString help, QString longhelp) |
| CommandLineArg * | add (const QString &arg, const QString &name, long long def, QString help, QString longhelp) |
| CommandLineArg * | add (const QString &arg, const QString &name, double def, QString help, QString longhelp) |
| CommandLineArg * | add (const QString &arg, const QString &name, const char *def, QString help, QString longhelp) |
| CommandLineArg * | add (const QString &arg, const QString &name, const QString &def, QString help, QString longhelp) |
| CommandLineArg * | add (const QString &arg, const QString &name, QSize def, QString help, QString longhelp) |
| CommandLineArg * | add (const QString &arg, const QString &name, const QDateTime &def, QString help, QString longhelp) |
| CommandLineArg * | add (const QString &arg, const QString &name, QMetaType::Type type, QString help, QString longhelp) |
| CommandLineArg * | add (const QString &arg, const QString &name, QMetaType::Type type, QVariant def, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, bool def, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, int def, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, uint def, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, long long def, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, double def, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, const char *def, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, const QString &def, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, QSize def, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, const QDateTime &def, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, QMetaType::Type type, QString help, QString longhelp) |
| CommandLineArg * | add (QStringList arglist, const QString &name, QMetaType::Type type, QVariant def, QString help, QString longhelp) |
| Add a new command line argument. More... | |
| QVariant | operator[] (const QString &name) |
| Returned stored QVariant for given argument, or default value if not used. More... | |
| QStringList | GetArgs (void) const |
| Return list of additional values provided on the command line independent of any keyword. More... | |
| QMap< QString, QString > | GetExtra (void) const |
| Return map of additional key/value pairs provided on the command line independent of any registered argument. More... | |
| QString | GetPassthrough (void) const |
| Return any text supplied on the command line after a bare '–'. More... | |
| QMap< QString, QString > | GetSettingsOverride (void) |
| Return map of key/value pairs provided to override database options. More... | |
| QString | GetLogFilePath (void) |
| Helper utility for logging interface to pull path from –logpath. More... | |
| int | GetSyslogFacility (void) const |
| Helper utility for logging interface to return syslog facility. More... | |
| LogLevel_t | GetLogLevel (void) const |
| Helper utility for logging interface to filtering level. More... | |
| QString | GetAppName (void) const |
| bool | toBool (const QString &key) const |
| Returns stored QVariant as a boolean. More... | |
| int | toInt (const QString &key) const |
| Returns stored QVariant as an integer, falling to default if not provided. More... | |
| uint | toUInt (const QString &key) const |
| Returns stored QVariant as an unsigned integer, falling to default if not provided. More... | |
| long long | toLongLong (const QString &key) const |
| Returns stored QVariant as a long integer, falling to default if not provided. More... | |
| double | toDouble (const QString &key) const |
| Returns stored QVariant as double floating point value, falling to default if not provided. More... | |
| QSize | toSize (const QString &key) const |
| Returns stored QVariant as a QSize value, falling to default if not provided. More... | |
| QString | toString (const QString &key) const |
| Returns stored QVariant as a QString, falling to default if not provided. More... | |
| QStringList | toStringList (const QString &key, const QString &sep="") const |
| Returns stored QVariant as a QStringList, falling to default if not provided. More... | |
| QMap< QString, QString > | toMap (const QString &key) const |
| Returns stored QVariant as a QMap, falling to default if not provided. More... | |
| QDateTime | toDateTime (const QString &key) const |
| Returns stored QVariant as a QDateTime, falling to default if not provided. More... | |
| bool | SetValue (const QString &key, const QVariant &value) |
| Set a new stored value for an existing argument definition, or spawn a new definition store value in. More... | |
| int | ConfigureLogging (const QString &mask="general", bool progress=false) |
| Read in logging options and initialize the logging interface. More... | |
| void | ApplySettingsOverride (void) |
| Apply all overrides to the global context. More... | |
| int | Daemonize (void) const |
| Fork application into background, and detatch from terminal. More... | |
Static Public Member Functions | |
| static QStringList | MythSplitCommandString (const QString &line) |
| Parse a string into separate tokens. More... | |
| static void | PrintVersion (void) |
| Print application version information. More... | |
| static const char * | NamedOptType (Result type) |
Public Attributes | |
| friend | TestCommandLineParser |
Protected Member Functions | |
| void | allowArgs (bool allow=true) |
| Specify that parser should allow and collect values provided independent of any keyword. More... | |
| void | allowExtras (bool allow=true) |
| Specify that parser should allow and collect additional key/value pairs not explicitly defined for processing. More... | |
| void | allowPassthrough (bool allow=true) |
| Specify that parser should allow a bare '–', and collect all subsequent text as a QString. More... | |
| void | addHelp (void) |
| Canned argument definition for –help. More... | |
| void | addVersion (void) |
| Canned argument definition for –version. More... | |
| void | addWindowed (void) |
| Canned argument definition for –windowed and -no-windowed. More... | |
| void | addMouse (void) |
| Canned argument definition for –mouse-cursor and –no-mouse-cursor. More... | |
| void | addDaemon (void) |
| Canned argument definition for –daemon. More... | |
| void | addSettingsOverride (void) |
| Canned argument definition for –override-setting and –override-settings-file. More... | |
| void | addRecording (void) |
| Canned argument definition for –chanid and –starttime. More... | |
| void | addGeometry (void) |
| Canned argument definition for –geometry. More... | |
| void | addDisplay (void) |
| Canned argument definition for -display. More... | |
| void | addUPnP (void) |
| Canned argument definition for –noupnp. More... | |
| void | addDVBv3 (void) |
| Canned argument definition for –dvbv3. More... | |
| void | addLogging (const QString &defaultVerbosity="general", LogLevel_t defaultLogLevel=LOG_INFO) |
| Canned argument definition for all logging options, including –verbose, –logpath, –quiet, –loglevel, –syslog, –loglong. More... | |
| void | addPIDFile (void) |
| Canned argument definition for –pidfile. More... | |
| void | addJob (void) |
| Canned argument definition for –jobid. More... | |
| void | addInFile (bool addOutFile=false) |
| Canned argument definition for –infile and –outfile. More... | |
| void | addPlatform (void) |
| Pass through the platform argument to Qt for GUI applications. More... | |
Private Member Functions | |
| Result | getOpt (int argc, const char *const *argv, int &argpos, QString &opt, QByteArray &val) |
| Internal use. More... | |
| bool | ReconcileLinks (void) |
| Replace dummy arguments used to define interdependency with pointers to their real counterparts. More... | |
Private Attributes | |
| QString | m_appname |
| QMap< QString, CommandLineArg * > | m_optionedArgs |
| QMap< QString, CommandLineArg * > | m_namedArgs |
| bool | m_passthroughActive {false} |
| bool | m_overridesImported {false} |
| bool | m_verbose {false} |
Parent class for defining application command line parsers.
This class provides a generic interface for defining and parsing available command line options. Options can be provided manually using the add() method, or one of several canned add*() methods. Once defined, the command line is parsed using the Parse() method, and results are available through Qt standard to<Type>() methods.
Definition at line 116 of file mythcommandlineparser.h.
|
strong |
| Enumerator | |
|---|---|
| kEnd | |
| kEmpty | |
| kOptOnly | |
| kOptVal | |
| kCombOptVal | |
| kArg | |
| kPassthrough | |
| kInvalid | |
Definition at line 121 of file mythcommandlineparser.h.
|
explicit |
Default constructor for MythCommandLineArg class.
Definition at line 1279 of file mythcommandlineparser.cpp.
|
virtual |
Definition at line 1291 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| bool | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1780 of file mythcommandlineparser.cpp.
Referenced by add(), addDaemon(), addDisplay(), addDVBv3(), addGeometry(), addHelp(), addInFile(), addJob(), addLogging(), addMouse(), addPIDFile(), addPlatform(), addRecording(), addSettingsOverride(), addUPnP(), addVersion(), addWindowed(), MythArchiveHelperCommandLineParser::LoadArguments(), MythFillNVCommandLineParser::LoadArguments(), MythAVTestCommandLineParser::LoadArguments(), MythBackendCommandLineParser::LoadArguments(), MythCCExtractorCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), MythFillDatabaseCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythLCDServerCommandLineParser::LoadArguments(), MythMetadataLookupCommandLineParser::LoadArguments(), MythPreviewGeneratorCommandLineParser::LoadArguments(), MythShutdownCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythUtilCommandLineParser::LoadArguments(), and MythWelcomeCommandLineParser::LoadArguments().
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| const char * | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1810 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| const QDateTime & | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1828 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| const QString & | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1816 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| double | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1804 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| int | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1786 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| long long | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1798 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| QMetaType::Type | type, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1834 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| QMetaType::Type | type, | ||
| QVariant | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1846 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| QSize | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1822 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
| const QString & | name, | ||
| uint | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1792 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| bool | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1853 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| const char * | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1883 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| const QDateTime & | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1901 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| const QString & | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1889 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| double | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1877 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| int | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1859 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| long long | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1871 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| QMetaType::Type | type, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1907 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| QMetaType::Type | type, | ||
| QVariant | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Add a new command line argument.
This is the primary method for adding new arguments for processing. There are several overloaded convenience methods that tie into this, allowing it to be called with fewer inputs.
| arglist | list of arguments to allow use of on the command line |
| name | internal name to be used when pulling processed data out |
| type | type of variable to be processed. The allowed types are listed below. |
| def | default value to provide if one is not supplied or option is not used |
| help | short help text, displayed when printing all available options with '–help'. If this is empty, the argument will not be shown |
| longhelp | Extended help text, displayed when help about a specific option is requested using '–help <option>' |
| Type | Description |
|---|---|
| Bool | set to value, or default if value is not provided |
| String | set to value, or default if value is not provided |
| Int | set to value, or behaves as counter for multiple uses if value is not provided |
| UInt | |
| LongLong | |
| Double | |
| DateTime | accepts ISO8601 and Myth's flattened version |
| StringList | accepts multiple uses, appended as individual strings |
| Map | accepts multiple pairs, in the syntax "key=value" |
| Size | accepts size in the syntax "XxY" |
Definition at line 1350 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| QSize | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1895 of file mythcommandlineparser.cpp.
| CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
| const QString & | name, | ||
| uint | def, | ||
| QString | help, | ||
| QString | longhelp | ||
| ) |
Definition at line 1865 of file mythcommandlineparser.cpp.
|
protected |
Canned argument definition for –daemon.
Definition at line 2601 of file mythcommandlineparser.cpp.
Referenced by MythBackendCommandLineParser::LoadArguments(), MythJobQueueCommandLineParser::LoadArguments(), MythLCDServerCommandLineParser::LoadArguments(), and MythMediaServerCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for -display.
Only works on X11 systems.
Definition at line 2767 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), and MythWelcomeCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –dvbv3.
Definition at line 2658 of file mythcommandlineparser.cpp.
Referenced by MythBackendCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –geometry.
Definition at line 2642 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), and MythWelcomeCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –help.
Definition at line 2549 of file mythcommandlineparser.cpp.
Referenced by MythArchiveHelperCommandLineParser::LoadArguments(), MythFillNVCommandLineParser::LoadArguments(), MythAVTestCommandLineParser::LoadArguments(), MythBackendCommandLineParser::LoadArguments(), MythCCExtractorCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), MythFillDatabaseCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythJobQueueCommandLineParser::LoadArguments(), MythLCDServerCommandLineParser::LoadArguments(), MythMediaServerCommandLineParser::LoadArguments(), MythMetadataLookupCommandLineParser::LoadArguments(), MythPreviewGeneratorCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythShutdownCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythUtilCommandLineParser::LoadArguments(), and MythWelcomeCommandLineParser::LoadArguments().
Canned argument definition for –infile and –outfile.
Definition at line 2758 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), and MythUtilCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –jobid.
Definition at line 2748 of file mythcommandlineparser.cpp.
Referenced by MythCommFlagCommandLineParser::LoadArguments(), MythMetadataLookupCommandLineParser::LoadArguments(), and MythTranscodeCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for all logging options, including –verbose, –logpath, –quiet, –loglevel, –syslog, –loglong.
Definition at line 2666 of file mythcommandlineparser.cpp.
Referenced by MythArchiveHelperCommandLineParser::LoadArguments(), MythFillNVCommandLineParser::LoadArguments(), MythAVTestCommandLineParser::LoadArguments(), MythBackendCommandLineParser::LoadArguments(), MythCCExtractorCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), MythFillDatabaseCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythJobQueueCommandLineParser::LoadArguments(), MythLCDServerCommandLineParser::LoadArguments(), MythMediaServerCommandLineParser::LoadArguments(), MythMetadataLookupCommandLineParser::LoadArguments(), MythPreviewGeneratorCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythShutdownCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythUtilCommandLineParser::LoadArguments(), and MythWelcomeCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –mouse-cursor and –no-mouse-cursor.
Definition at line 2587 of file mythcommandlineparser.cpp.
Referenced by MythFrontendCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), and MythWelcomeCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –pidfile.
Definition at line 2736 of file mythcommandlineparser.cpp.
Referenced by MythBackendCommandLineParser::LoadArguments(), MythJobQueueCommandLineParser::LoadArguments(), and MythMediaServerCommandLineParser::LoadArguments().
|
protected |
Pass through the platform argument to Qt for GUI applications.
Definition at line 2778 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), and MythWelcomeCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –chanid and –starttime.
Definition at line 2629 of file mythcommandlineparser.cpp.
Referenced by MythCommFlagCommandLineParser::LoadArguments(), MythMetadataLookupCommandLineParser::LoadArguments(), MythPreviewGeneratorCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), and MythUtilCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –override-setting and –override-settings-file.
Definition at line 2613 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythBackendCommandLineParser::LoadArguments(), MythCCExtractorCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythJobQueueCommandLineParser::LoadArguments(), MythMediaServerCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythUtilCommandLineParser::LoadArguments(), and MythWelcomeCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –noupnp.
Definition at line 2651 of file mythcommandlineparser.cpp.
Referenced by MythBackendCommandLineParser::LoadArguments(), and MythFrontendCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –version.
Definition at line 2562 of file mythcommandlineparser.cpp.
Referenced by MythArchiveHelperCommandLineParser::LoadArguments(), MythFillNVCommandLineParser::LoadArguments(), MythAVTestCommandLineParser::LoadArguments(), MythBackendCommandLineParser::LoadArguments(), MythCCExtractorCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), MythFillDatabaseCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythJobQueueCommandLineParser::LoadArguments(), MythLCDServerCommandLineParser::LoadArguments(), MythMediaServerCommandLineParser::LoadArguments(), MythMetadataLookupCommandLineParser::LoadArguments(), MythPreviewGeneratorCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythShutdownCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythUtilCommandLineParser::LoadArguments(), and MythWelcomeCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –windowed and -no-windowed.
Definition at line 2572 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), and MythWelcomeCommandLineParser::LoadArguments().
Specify that parser should allow and collect values provided independent of any keyword.
Definition at line 2490 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), and MythFileRecorderCommandLineParser::LoadArguments().
Specify that parser should allow and collect additional key/value pairs not explicitly defined for processing.
Definition at line 2509 of file mythcommandlineparser.cpp.
Referenced by MythUtilCommandLineParser::LoadArguments().
Specify that parser should allow a bare '–', and collect all subsequent text as a QString.
Definition at line 2530 of file mythcommandlineparser.cpp.
Referenced by MythFillDatabaseCommandLineParser::LoadArguments().
| void MythCommandLineParser::ApplySettingsOverride | ( | void | ) |
Apply all overrides to the global context.
WARNING: this must not be called until after MythContext is initialized
Definition at line 2951 of file mythcommandlineparser.cpp.
Referenced by main().
| int MythCommandLineParser::ConfigureLogging | ( | const QString & | mask = "general", |
| bool | progress = false |
||
| ) |
Read in logging options and initialize the logging interface.
Definition at line 2880 of file mythcommandlineparser.cpp.
Referenced by main(), and main_local().
| int MythCommandLineParser::Daemonize | ( | void | ) | const |
Fork application into background, and detatch from terminal.
Definition at line 3057 of file mythcommandlineparser.cpp.
Referenced by main().
|
inline |
Definition at line 224 of file mythcommandlineparser.h.
| QStringList MythCommandLineParser::GetArgs | ( | void | ) | const |
Return list of additional values provided on the command line independent of any keyword.
Definition at line 2099 of file mythcommandlineparser.cpp.
Referenced by main().
| QMap< QString, QString > MythCommandLineParser::GetExtra | ( | void | ) | const |
Return map of additional key/value pairs provided on the command line independent of any registered argument.
Definition at line 2107 of file mythcommandlineparser.cpp.
Referenced by SendMessage().
|
inlinevirtual |
Reimplemented in MythAVTestCommandLineParser, MythBackendCommandLineParser, MythCCExtractorCommandLineParser, MythExternRecorderCommandLineParser, MythFileRecorderCommandLineParser, MythFrontendCommandLineParser, MythJobQueueCommandLineParser, MythMediaServerCommandLineParser, MythScreenWizardCommandLineParser, MythTVSetupCommandLineParser, MythUtilCommandLineParser, and MythWelcomeCommandLineParser.
Definition at line 141 of file mythcommandlineparser.h.
Referenced by GetHelpString().
| QString MythCommandLineParser::GetHelpString | ( | void | ) | const |
Generate command line option help text.
Generates generic help or specific help, depending on whether a value was provided to the –help option
Definition at line 1417 of file mythcommandlineparser.cpp.
Referenced by PrintHelp().
| QString MythCommandLineParser::GetLogFilePath | ( | void | ) |
Helper utility for logging interface to pull path from –logpath.
Definition at line 2787 of file mythcommandlineparser.cpp.
Referenced by ConfigureLogging(), and main().
| LogLevel_t MythCommandLineParser::GetLogLevel | ( | void | ) | const |
Helper utility for logging interface to filtering level.
Definition at line 2829 of file mythcommandlineparser.cpp.
Referenced by ConfigureLogging().
|
private |
Internal use.
Pull next key/value pair from argv.
Definition at line 1481 of file mythcommandlineparser.cpp.
Referenced by Parse().
| QString MythCommandLineParser::GetPassthrough | ( | void | ) | const |
Return any text supplied on the command line after a bare '–'.
Definition at line 2114 of file mythcommandlineparser.cpp.
| QMap< QString, QString > MythCommandLineParser::GetSettingsOverride | ( | void | ) |
Return map of key/value pairs provided to override database options.
This method is used for the -O/–override-setting options, as well as the specific arguments to override the window border and mouse cursor. On its first use, this method will also read in any addition settings provided in the –override-settings-file
Definition at line 2126 of file mythcommandlineparser.cpp.
Referenced by ApplySettingsOverride().
| int MythCommandLineParser::GetSyslogFacility | ( | void | ) | const |
Helper utility for logging interface to return syslog facility.
Definition at line 2818 of file mythcommandlineparser.cpp.
Referenced by ConfigureLogging().
|
inlinevirtual |
Reimplemented in MythArchiveHelperCommandLineParser, MythFillNVCommandLineParser, MythAVTestCommandLineParser, MythBackendCommandLineParser, MythCCExtractorCommandLineParser, MythCommFlagCommandLineParser, MythExternRecorderCommandLineParser, MythFileRecorderCommandLineParser, MythFillDatabaseCommandLineParser, MythFrontendCommandLineParser, MythJobQueueCommandLineParser, MythLCDServerCommandLineParser, MythMediaServerCommandLineParser, MythMetadataLookupCommandLineParser, MythPreviewGeneratorCommandLineParser, MythScreenWizardCommandLineParser, MythShutdownCommandLineParser, MythTranscodeCommandLineParser, MythTVSetupCommandLineParser, MythUtilCommandLineParser, and MythWelcomeCommandLineParser.
Definition at line 137 of file mythcommandlineparser.h.
Referenced by MythCommandLineParser().
|
static |
Parse a string into separate tokens.
This function understands quoting and the escape character.
Definition at line 156 of file mythcommandlineparser.cpp.
Referenced by MythExternRecApp::Cleanup(), MythExternRecApp::DataStarted(), MythExternRecApp::LoadChannels(), MythExternRecApp::NewEpisodeStarting(), MythExternRecApp::StartStreaming(), and MythExternRecApp::TuneChannel().
|
static |
Definition at line 223 of file mythcommandlineparser.cpp.
Referenced by Parse().
| QVariant MythCommandLineParser::operator[] | ( | const QString & | name | ) |
Returned stored QVariant for given argument, or default value if not used.
Definition at line 2080 of file mythcommandlineparser.cpp.
|
virtual |
Loop through argv and populate arguments with values.
This should not be called until all arguments are added to the parser. This returns false if the parser hits an argument it is not designed to handle.
Definition at line 1562 of file mythcommandlineparser.cpp.
Referenced by main(), and main_local().
| void MythCommandLineParser::PrintHelp | ( | void | ) | const |
Print command line option help.
Definition at line 1406 of file mythcommandlineparser.cpp.
Referenced by main(), and main_local().
|
static |
Print application version information.
Definition at line 1390 of file mythcommandlineparser.cpp.
Referenced by main(), and main_local().
|
private |
Replace dummy arguments used to define interdependency with pointers to their real counterparts.
Definition at line 1923 of file mythcommandlineparser.cpp.
Referenced by Parse().
| bool MythCommandLineParser::SetValue | ( | const QString & | key, |
| const QVariant & | value | ||
| ) |
Set a new stored value for an existing argument definition, or spawn a new definition store value in.
Argument is subsequently marked as being provided on the command line.
Definition at line 2847 of file mythcommandlineparser.cpp.
Referenced by GetLogFilePath(), main(), and Parse().
| bool MythCommandLineParser::toBool | ( | const QString & | key | ) | const |
Returns stored QVariant as a boolean.
If the stored value is of type boolean, this will return the actual stored or default value. For all other types, this will return whether the argument was supplied on the command line or not.
Definition at line 2207 of file mythcommandlineparser.cpp.
Referenced by CheckRecordings(), ClearEIT(), ConfigureLogging(), MythDisplay::ConfigureQtGUI(), Daemonize(), FlagCommercials(), GetProgramInfo(), GetSettingsOverride(), handle_command(), main(), main_local(), Parse(), pid_printer(), print_warnings(), QueueCommFlagJob(), run_backend(), ScanMusic(), and SendMessage().
| QDateTime MythCommandLineParser::toDateTime | ( | const QString & | key | ) | const |
Returns stored QVariant as a QDateTime, falling to default if not provided.
Definition at line 2463 of file mythcommandlineparser.cpp.
Referenced by GetProgramInfo(), main(), and UpdateMeta().
| double MythCommandLineParser::toDouble | ( | const QString & | key | ) | const |
Returns stored QVariant as double floating point value, falling to default if not provided.
Definition at line 2310 of file mythcommandlineparser.cpp.
| int MythCommandLineParser::toInt | ( | const QString & | key | ) | const |
Returns stored QVariant as an integer, falling to default if not provided.
Definition at line 2229 of file mythcommandlineparser.cpp.
Referenced by CalcTrackLength(), ClearEIT(), ConfigureLogging(), ExtractImage(), FindLyrics(), main(), main_local(), QueueJob(), and UpdateMeta().
| long long MythCommandLineParser::toLongLong | ( | const QString & | key | ) | const |
Returns stored QVariant as a long integer, falling to default if not provided.
Definition at line 2283 of file mythcommandlineparser.cpp.
Referenced by ConfigureLogging(), and main().
| QMap< QString, QString > MythCommandLineParser::toMap | ( | const QString & | key | ) | const |
Returns stored QVariant as a QMap, falling to default if not provided.
Definition at line 2429 of file mythcommandlineparser.cpp.
Referenced by GetExtra(), and GetSettingsOverride().
| QSize MythCommandLineParser::toSize | ( | const QString & | key | ) | const |
Returns stored QVariant as a QSize value, falling to default if not provided.
Definition at line 2337 of file mythcommandlineparser.cpp.
Referenced by main().
| QString MythCommandLineParser::toString | ( | const QString & | key | ) | const |
Returns stored QVariant as a QString, falling to default if not provided.
Definition at line 2364 of file mythcommandlineparser.cpp.
Referenced by CalcTrackLength(), ConfigureLogging(), MythDisplay::ConfigureQtGUI(), CopyFile(), Daemonize(), DownloadFile(), ExtractImage(), FindLyrics(), FlagCommercials(), GetHelpString(), GetLogFilePath(), GetLogLevel(), GetMarkup(), GetProgramInfo(), GetSettingsOverride(), GetSyslogFacility(), handle_command(), main(), main_local(), ParseVideoFilename(), pid_counter(), pid_filter(), pid_printer(), QueueJob(), SendMessage(), SendSystemEvent(), SetCutList(), SetMarkup(), SetSkipList(), UpdateMeta(), and ~MythCommandLineParser().
| QStringList MythCommandLineParser::toStringList | ( | const QString & | key, |
| const QString & | sep = "" |
||
| ) | const |
Returns stored QVariant as a QStringList, falling to default if not provided.
Optional separator can be specified to split result if stored value is a QString.
Definition at line 2395 of file mythcommandlineparser.cpp.
Referenced by GetArgs(), GetPassthrough(), main(), Parse(), and SendEvent().
| uint MythCommandLineParser::toUInt | ( | const QString & | key | ) | const |
Returns stored QVariant as an unsigned integer, falling to default if not provided.
Definition at line 2256 of file mythcommandlineparser.cpp.
Referenced by MythDisplay::ConfigureQtGUI(), GetProgramInfo(), main(), main_local(), pid_counter(), pid_filter(), and SendMessage().
|
private |
Definition at line 271 of file mythcommandlineparser.h.
Referenced by GetHelpString().
|
private |
Definition at line 273 of file mythcommandlineparser.h.
Referenced by add(), allowArgs(), allowExtras(), allowPassthrough(), GetHelpString(), GetSettingsOverride(), operator[](), Parse(), ReconcileLinks(), SetValue(), toBool(), toDateTime(), toDouble(), toInt(), toLongLong(), toMap(), toSize(), toString(), toStringList(), toUInt(), and ~MythCommandLineParser().
|
private |
Definition at line 272 of file mythcommandlineparser.h.
Referenced by add(), GetHelpString(), Parse(), and ~MythCommandLineParser().
Definition at line 275 of file mythcommandlineparser.h.
Referenced by GetSettingsOverride().
Definition at line 274 of file mythcommandlineparser.h.
Definition at line 276 of file mythcommandlineparser.h.
Referenced by add(), ApplySettingsOverride(), GetSettingsOverride(), MythCommandLineParser(), Parse(), and ReconcileLinks().
| friend MythCommandLineParser::TestCommandLineParser |
Definition at line 119 of file mythcommandlineparser.h.