MythTV
master
|
Parent class for defining application command line parsers. More...
#include <libmythbase/mythcommandlineparser.h>
Public Types | |
enum | Result : std::uint8_t { Result::kEnd = 0, Result::kEmpty = 1, Result::kOptOnly = 2, Result::kOptVal = 3, Result::kCombOptVal = 4, Result::kArg = 5, Result::kPassthrough = 6, Result::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 1275 of file mythcommandlineparser.cpp.
|
virtual |
Definition at line 1287 of file mythcommandlineparser.cpp.
|
static |
Parse a string into separate tokens.
This function understands quoting and the escape character.
Definition at line 152 of file mythcommandlineparser.cpp.
Referenced by MythExternRecApp::Cleanup(), MythExternRecApp::DataStarted(), MythExternRecApp::LoadChannels(), MythExternRecApp::NewEpisodeStarting(), MythExternRecApp::StartStreaming(), and MythExternRecApp::TuneChannel().
|
inlinevirtual |
Reimplemented in MythArchiveHelperCommandLineParser, MythFillNVCommandLineParser, MythCCExtractorCommandLineParser, MythUtilCommandLineParser, MythBackendCommandLineParser, MythMediaServerCommandLineParser, MythAVTestCommandLineParser, MythCommFlagCommandLineParser, MythExternRecorderCommandLineParser, MythFileRecorderCommandLineParser, MythFillDatabaseCommandLineParser, MythFrontendCommandLineParser, MythJobQueueCommandLineParser, MythLCDServerCommandLineParser, MythPreviewGeneratorCommandLineParser, MythScreenWizardCommandLineParser, MythShutdownCommandLineParser, MythTranscodeCommandLineParser, MythTVSetupCommandLineParser, MythWelcomeCommandLineParser, and MythMetadataLookupCommandLineParser.
Definition at line 137 of file mythcommandlineparser.h.
Referenced by MythCommandLineParser().
|
static |
Print application version information.
Definition at line 1380 of file mythcommandlineparser.cpp.
Referenced by main(), and main_local().
void MythCommandLineParser::PrintHelp | ( | void | ) | const |
Print command line option help.
Definition at line 1396 of file mythcommandlineparser.cpp.
Referenced by main(), and main_local().
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 1407 of file mythcommandlineparser.cpp.
Referenced by PrintHelp().
|
inlinevirtual |
Reimplemented in MythCCExtractorCommandLineParser, MythUtilCommandLineParser, MythBackendCommandLineParser, MythMediaServerCommandLineParser, MythAVTestCommandLineParser, MythExternRecorderCommandLineParser, MythFileRecorderCommandLineParser, MythFrontendCommandLineParser, MythJobQueueCommandLineParser, MythScreenWizardCommandLineParser, MythTVSetupCommandLineParser, and MythWelcomeCommandLineParser.
Definition at line 141 of file mythcommandlineparser.h.
Referenced by GetHelpString().
|
static |
Definition at line 219 of file mythcommandlineparser.cpp.
Referenced by Parse().
|
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 1552 of file mythcommandlineparser.cpp.
Referenced by main(), and main_local().
CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
const QString & | name, | ||
bool | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1770 of file mythcommandlineparser.cpp.
Referenced by add(), addDaemon(), addDisplay(), addDVBv3(), addGeometry(), addHelp(), addInFile(), addJob(), addLogging(), addMouse(), addPIDFile(), addPlatform(), addRecording(), addSettingsOverride(), addUPnP(), addVersion(), addWindowed(), MythMetadataLookupCommandLineParser::LoadArguments(), MythWelcomeCommandLineParser::LoadArguments(), MythShutdownCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythPreviewGeneratorCommandLineParser::LoadArguments(), MythLCDServerCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), MythAVTestCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythFillDatabaseCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythBackendCommandLineParser::LoadArguments(), MythUtilCommandLineParser::LoadArguments(), MythCCExtractorCommandLineParser::LoadArguments(), MythFillNVCommandLineParser::LoadArguments(), and MythArchiveHelperCommandLineParser::LoadArguments().
CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
const QString & | name, | ||
int | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1776 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
const QString & | name, | ||
uint | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1782 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
const QString & | name, | ||
long long | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1788 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
const QString & | name, | ||
double | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1794 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
const QString & | name, | ||
const char * | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1800 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
const QString & | name, | ||
const QString & | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1806 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
const QString & | name, | ||
QSize | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1812 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
const QString & | name, | ||
const QDateTime & | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1818 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | const QString & | arg, |
const QString & | name, | ||
QMetaType::Type | type, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1824 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 1836 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
const QString & | name, | ||
bool | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1843 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
const QString & | name, | ||
int | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1849 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
const QString & | name, | ||
uint | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1855 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
const QString & | name, | ||
long long | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1861 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
const QString & | name, | ||
double | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1867 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
const QString & | name, | ||
const char * | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1873 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
const QString & | name, | ||
const QString & | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1879 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
const QString & | name, | ||
QSize | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1885 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
const QString & | name, | ||
const QDateTime & | def, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1891 of file mythcommandlineparser.cpp.
CommandLineArg * MythCommandLineParser::add | ( | QStringList | arglist, |
const QString & | name, | ||
QMetaType::Type | type, | ||
QString | help, | ||
QString | longhelp | ||
) |
Definition at line 1897 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 1340 of file mythcommandlineparser.cpp.
QVariant MythCommandLineParser::operator[] | ( | const QString & | name | ) |
Returned stored QVariant for given argument, or default value if not used.
Definition at line 2070 of file mythcommandlineparser.cpp.
QStringList MythCommandLineParser::GetArgs | ( | void | ) | const |
Return list of additional values provided on the command line independent of any keyword.
Definition at line 2089 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 2097 of file mythcommandlineparser.cpp.
Referenced by SendMessage().
QString MythCommandLineParser::GetPassthrough | ( | void | ) | const |
Return any text supplied on the command line after a bare '–'.
Definition at line 2104 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 2116 of file mythcommandlineparser.cpp.
Referenced by ApplySettingsOverride().
QString MythCommandLineParser::GetLogFilePath | ( | void | ) |
Helper utility for logging interface to pull path from –logpath.
Definition at line 2777 of file mythcommandlineparser.cpp.
Referenced by ConfigureLogging(), and main().
int MythCommandLineParser::GetSyslogFacility | ( | void | ) | const |
Helper utility for logging interface to return syslog facility.
Definition at line 2808 of file mythcommandlineparser.cpp.
Referenced by ConfigureLogging().
LogLevel_t MythCommandLineParser::GetLogLevel | ( | void | ) | const |
Helper utility for logging interface to filtering level.
Definition at line 2819 of file mythcommandlineparser.cpp.
Referenced by ConfigureLogging().
|
inline |
Definition at line 224 of file mythcommandlineparser.h.
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 2197 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().
int MythCommandLineParser::toInt | ( | const QString & | key | ) | const |
Returns stored QVariant as an integer, falling to default if not provided.
Definition at line 2219 of file mythcommandlineparser.cpp.
Referenced by CalcTrackLength(), ClearEIT(), ConfigureLogging(), ExtractImage(), FindLyrics(), main(), main_local(), QueueJob(), and UpdateMeta().
uint MythCommandLineParser::toUInt | ( | const QString & | key | ) | const |
Returns stored QVariant as an unsigned integer, falling to default if not provided.
Definition at line 2246 of file mythcommandlineparser.cpp.
Referenced by MythDisplay::ConfigureQtGUI(), GetProgramInfo(), main(), main_local(), pid_counter(), pid_filter(), and SendMessage().
long long MythCommandLineParser::toLongLong | ( | const QString & | key | ) | const |
Returns stored QVariant as a long integer, falling to default if not provided.
Definition at line 2273 of file mythcommandlineparser.cpp.
Referenced by ConfigureLogging(), and main().
double MythCommandLineParser::toDouble | ( | const QString & | key | ) | const |
Returns stored QVariant as double floating point value, falling to default if not provided.
Definition at line 2300 of file mythcommandlineparser.cpp.
QSize MythCommandLineParser::toSize | ( | const QString & | key | ) | const |
Returns stored QVariant as a QSize value, falling to default if not provided.
Definition at line 2327 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 2354 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(), run_backend(), SendMessage(), SendSystemEvent(), SetCutList(), SetMarkup(), SetSkipList(), and UpdateMeta().
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 2385 of file mythcommandlineparser.cpp.
Referenced by GetArgs(), GetPassthrough(), main(), Parse(), and SendEvent().
QMap< QString, QString > MythCommandLineParser::toMap | ( | const QString & | key | ) | const |
Returns stored QVariant as a QMap, falling to default if not provided.
Definition at line 2419 of file mythcommandlineparser.cpp.
Referenced by GetExtra(), and GetSettingsOverride().
QDateTime MythCommandLineParser::toDateTime | ( | const QString & | key | ) | const |
Returns stored QVariant as a QDateTime, falling to default if not provided.
Definition at line 2453 of file mythcommandlineparser.cpp.
Referenced by GetProgramInfo(), main(), and UpdateMeta().
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 2837 of file mythcommandlineparser.cpp.
Referenced by GetLogFilePath(), main(), and Parse().
int MythCommandLineParser::ConfigureLogging | ( | const QString & | mask = "general" , |
bool | progress = false |
||
) |
Read in logging options and initialize the logging interface.
Definition at line 2870 of file mythcommandlineparser.cpp.
Referenced by main(), and main_local().
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 2941 of file mythcommandlineparser.cpp.
Referenced by main().
int MythCommandLineParser::Daemonize | ( | void | ) | const |
Fork application into background, and detatch from terminal.
Definition at line 3047 of file mythcommandlineparser.cpp.
Referenced by main().
Specify that parser should allow and collect values provided independent of any keyword.
Definition at line 2480 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), and MythExternRecorderCommandLineParser::LoadArguments().
Specify that parser should allow and collect additional key/value pairs not explicitly defined for processing.
Definition at line 2499 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 2520 of file mythcommandlineparser.cpp.
Referenced by MythFillDatabaseCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –help.
Definition at line 2539 of file mythcommandlineparser.cpp.
Referenced by MythMetadataLookupCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), MythFillDatabaseCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythShutdownCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythPreviewGeneratorCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythWelcomeCommandLineParser::LoadArguments(), MythJobQueueCommandLineParser::LoadArguments(), MythAVTestCommandLineParser::LoadArguments(), MythLCDServerCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythBackendCommandLineParser::LoadArguments(), MythMediaServerCommandLineParser::LoadArguments(), MythUtilCommandLineParser::LoadArguments(), MythCCExtractorCommandLineParser::LoadArguments(), MythFillNVCommandLineParser::LoadArguments(), and MythArchiveHelperCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –version.
Definition at line 2552 of file mythcommandlineparser.cpp.
Referenced by MythMetadataLookupCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), MythFillDatabaseCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythShutdownCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythPreviewGeneratorCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythWelcomeCommandLineParser::LoadArguments(), MythJobQueueCommandLineParser::LoadArguments(), MythAVTestCommandLineParser::LoadArguments(), MythLCDServerCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythBackendCommandLineParser::LoadArguments(), MythMediaServerCommandLineParser::LoadArguments(), MythUtilCommandLineParser::LoadArguments(), MythCCExtractorCommandLineParser::LoadArguments(), MythFillNVCommandLineParser::LoadArguments(), and MythArchiveHelperCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –windowed and -no-windowed.
Definition at line 2562 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythWelcomeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), and MythFrontendCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –mouse-cursor and –no-mouse-cursor.
Definition at line 2577 of file mythcommandlineparser.cpp.
Referenced by MythFrontendCommandLineParser::LoadArguments(), MythWelcomeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), and MythScreenWizardCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –daemon.
Definition at line 2591 of file mythcommandlineparser.cpp.
Referenced by MythJobQueueCommandLineParser::LoadArguments(), MythLCDServerCommandLineParser::LoadArguments(), MythMediaServerCommandLineParser::LoadArguments(), and MythBackendCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –override-setting and –override-settings-file.
Definition at line 2603 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythWelcomeCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythJobQueueCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythMediaServerCommandLineParser::LoadArguments(), MythBackendCommandLineParser::LoadArguments(), MythUtilCommandLineParser::LoadArguments(), and MythCCExtractorCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –chanid and –starttime.
Definition at line 2619 of file mythcommandlineparser.cpp.
Referenced by MythMetadataLookupCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythPreviewGeneratorCommandLineParser::LoadArguments(), and MythUtilCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –geometry.
Definition at line 2632 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythWelcomeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), and MythFrontendCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for -display.
Only works on X11 systems.
Definition at line 2757 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythWelcomeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), and MythFrontendCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –noupnp.
Definition at line 2641 of file mythcommandlineparser.cpp.
Referenced by MythFrontendCommandLineParser::LoadArguments(), and MythBackendCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –dvbv3.
Definition at line 2648 of file mythcommandlineparser.cpp.
Referenced by MythBackendCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for all logging options, including –verbose, –logpath, –quiet, –loglevel, –syslog, –loglong.
Definition at line 2656 of file mythcommandlineparser.cpp.
Referenced by MythMetadataLookupCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), MythFillDatabaseCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), MythShutdownCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), MythPreviewGeneratorCommandLineParser::LoadArguments(), MythExternRecorderCommandLineParser::LoadArguments(), MythFrontendCommandLineParser::LoadArguments(), MythWelcomeCommandLineParser::LoadArguments(), MythJobQueueCommandLineParser::LoadArguments(), MythAVTestCommandLineParser::LoadArguments(), MythLCDServerCommandLineParser::LoadArguments(), MythCommFlagCommandLineParser::LoadArguments(), MythBackendCommandLineParser::LoadArguments(), MythMediaServerCommandLineParser::LoadArguments(), MythUtilCommandLineParser::LoadArguments(), MythCCExtractorCommandLineParser::LoadArguments(), MythFillNVCommandLineParser::LoadArguments(), and MythArchiveHelperCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –pidfile.
Definition at line 2726 of file mythcommandlineparser.cpp.
Referenced by MythJobQueueCommandLineParser::LoadArguments(), MythMediaServerCommandLineParser::LoadArguments(), and MythBackendCommandLineParser::LoadArguments().
|
protected |
Canned argument definition for –jobid.
Definition at line 2738 of file mythcommandlineparser.cpp.
Referenced by MythMetadataLookupCommandLineParser::LoadArguments(), MythTranscodeCommandLineParser::LoadArguments(), and MythCommFlagCommandLineParser::LoadArguments().
Canned argument definition for –infile and –outfile.
Definition at line 2748 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), and MythUtilCommandLineParser::LoadArguments().
|
protected |
Pass through the platform argument to Qt for GUI applications.
Definition at line 2768 of file mythcommandlineparser.cpp.
Referenced by MythAVTestCommandLineParser::LoadArguments(), MythWelcomeCommandLineParser::LoadArguments(), MythTVSetupCommandLineParser::LoadArguments(), MythScreenWizardCommandLineParser::LoadArguments(), and MythFrontendCommandLineParser::LoadArguments().
|
private |
Internal use.
Pull next key/value pair from argv.
Definition at line 1471 of file mythcommandlineparser.cpp.
Referenced by Parse().
|
private |
Replace dummy arguments used to define interdependency with pointers to their real counterparts.
Definition at line 1913 of file mythcommandlineparser.cpp.
Referenced by Parse().
friend MythCommandLineParser::TestCommandLineParser |
Definition at line 119 of file mythcommandlineparser.h.
|
private |
Definition at line 271 of file mythcommandlineparser.h.
Referenced by GetHelpString().
|
private |
Definition at line 272 of file mythcommandlineparser.h.
Referenced by add(), GetHelpString(), Parse(), and ~MythCommandLineParser().
|
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().
Definition at line 274 of file mythcommandlineparser.h.
Definition at line 275 of file mythcommandlineparser.h.
Referenced by GetSettingsOverride().
Definition at line 276 of file mythcommandlineparser.h.
Referenced by add(), ApplySettingsOverride(), GetSettingsOverride(), MythCommandLineParser(), Parse(), and ReconcileLinks().