MythTV  master
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
MythCommandLineParser Class Reference

Parent class for defining application command line parsers. More...

#include <mythcommandlineparser.h>

Inheritance diagram for MythCommandLineParser:
Inheritance graph
[legend]

Public Types

enum  Result {
  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...
 
CommandLineArgadd (const QString &arg, const QString &name, bool def, QString help, QString longhelp)
 
CommandLineArgadd (const QString &arg, const QString &name, int def, QString help, QString longhelp)
 
CommandLineArgadd (const QString &arg, const QString &name, uint def, QString help, QString longhelp)
 
CommandLineArgadd (const QString &arg, const QString &name, long long def, QString help, QString longhelp)
 
CommandLineArgadd (const QString &arg, const QString &name, double def, QString help, QString longhelp)
 
CommandLineArgadd (const QString &arg, const QString &name, const char *def, QString help, QString longhelp)
 
CommandLineArgadd (const QString &arg, const QString &name, const QString &def, QString help, QString longhelp)
 
CommandLineArgadd (const QString &arg, const QString &name, QSize def, QString help, QString longhelp)
 
CommandLineArgadd (const QString &arg, const QString &name, const QDateTime &def, QString help, QString longhelp)
 
CommandLineArgadd (const QString &arg, const QString &name, QMetaType::Type type, QString help, QString longhelp)
 
CommandLineArgadd (const QString &arg, const QString &name, QMetaType::Type type, QVariant def, QString help, QString longhelp)
 
CommandLineArgadd (QStringList arglist, const QString &name, bool def, QString help, QString longhelp)
 
CommandLineArgadd (QStringList arglist, const QString &name, int def, QString help, QString longhelp)
 
CommandLineArgadd (QStringList arglist, const QString &name, uint def, QString help, QString longhelp)
 
CommandLineArgadd (QStringList arglist, const QString &name, long long def, QString help, QString longhelp)
 
CommandLineArgadd (QStringList arglist, const QString &name, double def, QString help, QString longhelp)
 
CommandLineArgadd (QStringList arglist, const QString &name, const char *def, QString help, QString longhelp)
 
CommandLineArgadd (QStringList arglist, const QString &name, const QString &def, QString help, QString longhelp)
 
CommandLineArgadd (QStringList arglist, const QString &name, QSize def, QString help, QString longhelp)
 
CommandLineArgadd (QStringList arglist, const QString &name, const QDateTime &def, QString help, QString longhelp)
 
CommandLineArgadd (QStringList arglist, const QString &name, QMetaType::Type type, QString help, QString longhelp)
 
CommandLineArgadd (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. 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}
 

Detailed Description

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.

Member Enumeration Documentation

◆ Result

Enumerator
kEnd 
kEmpty 
kOptOnly 
kOptVal 
kCombOptVal 
kArg 
kPassthrough 
kInvalid 

Definition at line 121 of file mythcommandlineparser.h.

Constructor & Destructor Documentation

◆ MythCommandLineParser()

MythCommandLineParser::MythCommandLineParser ( QString  appname)
explicit

Default constructor for MythCommandLineArg class.

Definition at line 1267 of file mythcommandlineparser.cpp.

◆ ~MythCommandLineParser()

MythCommandLineParser::~MythCommandLineParser ( )
virtual

Definition at line 1279 of file mythcommandlineparser.cpp.

Member Function Documentation

◆ MythSplitCommandString()

QStringList MythCommandLineParser::MythSplitCommandString ( const QString &  line)
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().

◆ LoadArguments()

virtual void MythCommandLineParser::LoadArguments ( void  )
inlinevirtual

◆ PrintVersion()

void MythCommandLineParser::PrintVersion ( void  )
static

Print application version information.

Definition at line 1372 of file mythcommandlineparser.cpp.

Referenced by main(), and main_local().

◆ PrintHelp()

void MythCommandLineParser::PrintHelp ( void  ) const

Print command line option help.

Definition at line 1388 of file mythcommandlineparser.cpp.

Referenced by main(), and main_local().

◆ 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 1399 of file mythcommandlineparser.cpp.

Referenced by PrintHelp().

◆ GetHelpHeader()

virtual QString MythCommandLineParser::GetHelpHeader ( void  ) const
inlinevirtual

◆ NamedOptType()

const char * MythCommandLineParser::NamedOptType ( Result  type)
static

Definition at line 215 of file mythcommandlineparser.cpp.

Referenced by Parse().

◆ Parse()

bool MythCommandLineParser::Parse ( int  argc,
const char *const *  argv 
)
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 1544 of file mythcommandlineparser.cpp.

Referenced by main(), and main_local().

◆ add() [1/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
bool  def,
QString  help,
QString  longhelp 
)

◆ add() [2/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
int  def,
QString  help,
QString  longhelp 
)

Definition at line 1766 of file mythcommandlineparser.cpp.

◆ add() [3/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
uint  def,
QString  help,
QString  longhelp 
)

Definition at line 1772 of file mythcommandlineparser.cpp.

◆ add() [4/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
long long  def,
QString  help,
QString  longhelp 
)

Definition at line 1778 of file mythcommandlineparser.cpp.

◆ add() [5/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
double  def,
QString  help,
QString  longhelp 
)

Definition at line 1784 of file mythcommandlineparser.cpp.

◆ add() [6/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
const char *  def,
QString  help,
QString  longhelp 
)

Definition at line 1790 of file mythcommandlineparser.cpp.

◆ add() [7/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
const QString &  def,
QString  help,
QString  longhelp 
)

Definition at line 1796 of file mythcommandlineparser.cpp.

◆ add() [8/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
QSize  def,
QString  help,
QString  longhelp 
)

Definition at line 1802 of file mythcommandlineparser.cpp.

◆ add() [9/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
const QDateTime &  def,
QString  help,
QString  longhelp 
)

Definition at line 1808 of file mythcommandlineparser.cpp.

◆ add() [10/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
QMetaType::Type  type,
QString  help,
QString  longhelp 
)

Definition at line 1814 of file mythcommandlineparser.cpp.

◆ add() [11/22]

CommandLineArg * MythCommandLineParser::add ( const QString &  arg,
const QString &  name,
QMetaType::Type  type,
QVariant  def,
QString  help,
QString  longhelp 
)

Definition at line 1826 of file mythcommandlineparser.cpp.

◆ add() [12/22]

CommandLineArg * MythCommandLineParser::add ( QStringList  arglist,
const QString &  name,
bool  def,
QString  help,
QString  longhelp 
)

Definition at line 1833 of file mythcommandlineparser.cpp.

◆ add() [13/22]

CommandLineArg * MythCommandLineParser::add ( QStringList  arglist,
const QString &  name,
int  def,
QString  help,
QString  longhelp 
)

Definition at line 1839 of file mythcommandlineparser.cpp.

◆ add() [14/22]

CommandLineArg * MythCommandLineParser::add ( QStringList  arglist,
const QString &  name,
uint  def,
QString  help,
QString  longhelp 
)

Definition at line 1845 of file mythcommandlineparser.cpp.

◆ add() [15/22]

CommandLineArg * MythCommandLineParser::add ( QStringList  arglist,
const QString &  name,
long long  def,
QString  help,
QString  longhelp 
)

Definition at line 1851 of file mythcommandlineparser.cpp.

◆ add() [16/22]

CommandLineArg * MythCommandLineParser::add ( QStringList  arglist,
const QString &  name,
double  def,
QString  help,
QString  longhelp 
)

Definition at line 1857 of file mythcommandlineparser.cpp.

◆ add() [17/22]

CommandLineArg * MythCommandLineParser::add ( QStringList  arglist,
const QString &  name,
const char *  def,
QString  help,
QString  longhelp 
)

Definition at line 1863 of file mythcommandlineparser.cpp.

◆ add() [18/22]

CommandLineArg * MythCommandLineParser::add ( QStringList  arglist,
const QString &  name,
const QString &  def,
QString  help,
QString  longhelp 
)

Definition at line 1869 of file mythcommandlineparser.cpp.

◆ add() [19/22]

CommandLineArg * MythCommandLineParser::add ( QStringList  arglist,
const QString &  name,
QSize  def,
QString  help,
QString  longhelp 
)

Definition at line 1875 of file mythcommandlineparser.cpp.

◆ add() [20/22]

CommandLineArg * MythCommandLineParser::add ( QStringList  arglist,
const QString &  name,
const QDateTime &  def,
QString  help,
QString  longhelp 
)

Definition at line 1881 of file mythcommandlineparser.cpp.

◆ add() [21/22]

CommandLineArg * MythCommandLineParser::add ( QStringList  arglist,
const QString &  name,
QMetaType::Type  type,
QString  help,
QString  longhelp 
)

Definition at line 1887 of file mythcommandlineparser.cpp.

◆ add() [22/22]

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.

Parameters
arglistlist of arguments to allow use of on the command line
nameinternal name to be used when pulling processed data out
typetype of variable to be processed. The allowed types are listed below.
defdefault value to provide if one is not supplied or option is not used
helpshort help text, displayed when printing all available options with '–help'. If this is empty, the argument will not be shown
longhelpExtended 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 1332 of file mythcommandlineparser.cpp.

◆ operator[]()

QVariant MythCommandLineParser::operator[] ( const QString &  name)

Returned stored QVariant for given argument, or default value if not used.

Definition at line 2060 of file mythcommandlineparser.cpp.

◆ GetArgs()

QStringList MythCommandLineParser::GetArgs ( void  ) const

Return list of additional values provided on the command line independent of any keyword.

Definition at line 2079 of file mythcommandlineparser.cpp.

Referenced by main().

◆ GetExtra()

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 2087 of file mythcommandlineparser.cpp.

Referenced by SendMessage().

◆ GetPassthrough()

QString MythCommandLineParser::GetPassthrough ( void  ) const

Return any text supplied on the command line after a bare '–'.

Definition at line 2094 of file mythcommandlineparser.cpp.

Referenced by main(), and Parse().

◆ GetSettingsOverride()

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 2106 of file mythcommandlineparser.cpp.

Referenced by ApplySettingsOverride().

◆ GetLogFilePath()

QString MythCommandLineParser::GetLogFilePath ( void  )

Helper utility for logging interface to pull path from –logpath.

Definition at line 2756 of file mythcommandlineparser.cpp.

Referenced by ConfigureLogging(), and main().

◆ GetSyslogFacility()

int MythCommandLineParser::GetSyslogFacility ( void  ) const

Helper utility for logging interface to return syslog facility.

Definition at line 2787 of file mythcommandlineparser.cpp.

Referenced by ConfigureLogging().

◆ GetLogLevel()

LogLevel_t MythCommandLineParser::GetLogLevel ( void  ) const

Helper utility for logging interface to filtering level.

Definition at line 2798 of file mythcommandlineparser.cpp.

Referenced by ConfigureLogging().

◆ GetAppName()

QString MythCommandLineParser::GetAppName ( void  ) const
inline

Definition at line 224 of file mythcommandlineparser.h.

◆ toBool()

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 2187 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().

◆ toInt()

int MythCommandLineParser::toInt ( const QString &  key) const

Returns stored QVariant as an integer, falling to default if not provided.

Definition at line 2209 of file mythcommandlineparser.cpp.

Referenced by CalcTrackLength(), ClearEIT(), ConfigureLogging(), ExtractImage(), FindLyrics(), main(), main_local(), QueueJob(), and UpdateMeta().

◆ toUInt()

uint MythCommandLineParser::toUInt ( const QString &  key) const

Returns stored QVariant as an unsigned integer, falling to default if not provided.

Definition at line 2236 of file mythcommandlineparser.cpp.

Referenced by MythDisplay::ConfigureQtGUI(), GetProgramInfo(), main(), main_local(), pid_counter(), pid_filter(), and SendMessage().

◆ toLongLong()

long long MythCommandLineParser::toLongLong ( const QString &  key) const

Returns stored QVariant as a long integer, falling to default if not provided.

Definition at line 2263 of file mythcommandlineparser.cpp.

Referenced by ConfigureLogging(), and main().

◆ toDouble()

double MythCommandLineParser::toDouble ( const QString &  key) const

Returns stored QVariant as double floating point value, falling to default if not provided.

Definition at line 2290 of file mythcommandlineparser.cpp.

◆ toSize()

QSize MythCommandLineParser::toSize ( const QString &  key) const

Returns stored QVariant as a QSize value, falling to default if not provided.

Definition at line 2317 of file mythcommandlineparser.cpp.

Referenced by main().

◆ toString()

QString MythCommandLineParser::toString ( const QString &  key) const

◆ toStringList()

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 2375 of file mythcommandlineparser.cpp.

Referenced by GetArgs(), GetPassthrough(), main(), Parse(), and SendEvent().

◆ toMap()

QMap< QString, QString > MythCommandLineParser::toMap ( const QString &  key) const

Returns stored QVariant as a QMap, falling to default if not provided.

Definition at line 2407 of file mythcommandlineparser.cpp.

Referenced by GetExtra(), and GetSettingsOverride().

◆ toDateTime()

QDateTime MythCommandLineParser::toDateTime ( const QString &  key) const

Returns stored QVariant as a QDateTime, falling to default if not provided.

Definition at line 2441 of file mythcommandlineparser.cpp.

Referenced by GetProgramInfo(), main(), and UpdateMeta().

◆ SetValue()

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 2816 of file mythcommandlineparser.cpp.

Referenced by GetLogFilePath(), main(), and Parse().

◆ ConfigureLogging()

int MythCommandLineParser::ConfigureLogging ( const QString &  mask = "general",
bool  progress = false 
)

Read in logging options and initialize the logging interface.

Definition at line 2849 of file mythcommandlineparser.cpp.

Referenced by main(), and main_local().

◆ ApplySettingsOverride()

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 2916 of file mythcommandlineparser.cpp.

Referenced by main().

◆ Daemonize()

int MythCommandLineParser::Daemonize ( void  ) const

Fork application into background, and detatch from terminal.

Definition at line 3022 of file mythcommandlineparser.cpp.

Referenced by main().

◆ allowArgs()

void MythCommandLineParser::allowArgs ( bool  allow = true)
protected

Specify that parser should allow and collect values provided independent of any keyword.

Definition at line 2468 of file mythcommandlineparser.cpp.

Referenced by MythAVTestCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), and MythExternRecorderCommandLineParser::LoadArguments().

◆ allowExtras()

void MythCommandLineParser::allowExtras ( bool  allow = true)
protected

Specify that parser should allow and collect additional key/value pairs not explicitly defined for processing.

Definition at line 2485 of file mythcommandlineparser.cpp.

Referenced by MythUtilCommandLineParser::LoadArguments().

◆ allowPassthrough()

void MythCommandLineParser::allowPassthrough ( bool  allow = true)
protected

Specify that parser should allow a bare '–', and collect all subsequent text as a QString.

Definition at line 2504 of file mythcommandlineparser.cpp.

Referenced by MythFillDatabaseCommandLineParser::LoadArguments().

◆ addHelp()

void MythCommandLineParser::addHelp ( void  )
protected

◆ addVersion()

void MythCommandLineParser::addVersion ( void  )
protected

◆ addWindowed()

void MythCommandLineParser::addWindowed ( void  )
protected

◆ addMouse()

void MythCommandLineParser::addMouse ( void  )
protected

◆ addDaemon()

void MythCommandLineParser::addDaemon ( void  )
protected

◆ addSettingsOverride()

void MythCommandLineParser::addSettingsOverride ( void  )
protected

◆ addRecording()

void MythCommandLineParser::addRecording ( void  )
protected

◆ addGeometry()

void MythCommandLineParser::addGeometry ( void  )
protected

◆ addDisplay()

void MythCommandLineParser::addDisplay ( void  )
protected

◆ addUPnP()

void MythCommandLineParser::addUPnP ( void  )
protected

Canned argument definition for –noupnp.

Definition at line 2623 of file mythcommandlineparser.cpp.

Referenced by MythFrontendCommandLineParser::LoadArguments(), and MythBackendCommandLineParser::LoadArguments().

◆ addDVBv3()

void MythCommandLineParser::addDVBv3 ( void  )
protected

Canned argument definition for –dvbv3.

Definition at line 2630 of file mythcommandlineparser.cpp.

Referenced by MythBackendCommandLineParser::LoadArguments().

◆ addLogging()

void MythCommandLineParser::addLogging ( const QString &  defaultVerbosity = "general",
LogLevel_t  defaultLogLevel = LOG_INFO 
)
protected

◆ addPIDFile()

void MythCommandLineParser::addPIDFile ( void  )
protected

◆ addJob()

void MythCommandLineParser::addJob ( void  )
protected

◆ addInFile()

void MythCommandLineParser::addInFile ( bool  addOutFile = false)
protected

Canned argument definition for –infile and –outfile.

Definition at line 2727 of file mythcommandlineparser.cpp.

Referenced by MythAVTestCommandLineParser::LoadArguments(), MythFileRecorderCommandLineParser::LoadArguments(), and MythUtilCommandLineParser::LoadArguments().

◆ addPlatform()

void MythCommandLineParser::addPlatform ( void  )
protected

◆ getOpt()

MythCommandLineParser::Result MythCommandLineParser::getOpt ( int  argc,
const char *const *  argv,
int &  argpos,
QString &  opt,
QByteArray &  val 
)
private

Internal use.

Pull next key/value pair from argv.

Definition at line 1463 of file mythcommandlineparser.cpp.

Referenced by Parse().

◆ ReconcileLinks()

bool MythCommandLineParser::ReconcileLinks ( void  )
private

Replace dummy arguments used to define interdependency with pointers to their real counterparts.

Definition at line 1903 of file mythcommandlineparser.cpp.

Referenced by Parse().

Member Data Documentation

◆ TestCommandLineParser

friend MythCommandLineParser::TestCommandLineParser

Definition at line 119 of file mythcommandlineparser.h.

◆ m_appname

QString MythCommandLineParser::m_appname
private

Definition at line 271 of file mythcommandlineparser.h.

Referenced by GetHelpString().

◆ m_optionedArgs

QMap<QString,CommandLineArg*> MythCommandLineParser::m_optionedArgs
private

Definition at line 272 of file mythcommandlineparser.h.

Referenced by add(), GetHelpString(), Parse(), and ~MythCommandLineParser().

◆ m_namedArgs

QMap<QString,CommandLineArg*> MythCommandLineParser::m_namedArgs
private

◆ m_passthroughActive

bool MythCommandLineParser::m_passthroughActive {false}
private

Definition at line 274 of file mythcommandlineparser.h.

Referenced by getOpt(), and Parse().

◆ m_overridesImported

bool MythCommandLineParser::m_overridesImported {false}
private

Definition at line 275 of file mythcommandlineparser.h.

Referenced by GetSettingsOverride().

◆ m_verbose

bool MythCommandLineParser::m_verbose {false}
private

The documentation for this class was generated from the following files: